Feature: add dhcp type dns client (#1509)

This commit is contained in:
Kr328
2021-09-06 23:07:34 +08:00
committed by GitHub
parent a2d59d6ef5
commit a5b950a779
26 changed files with 759 additions and 288 deletions

View File

@ -10,6 +10,7 @@ import (
"github.com/Dreamacro/clash/adapter/outboundgroup"
"github.com/Dreamacro/clash/component/auth"
"github.com/Dreamacro/clash/component/dialer"
"github.com/Dreamacro/clash/component/iface"
"github.com/Dreamacro/clash/component/profile"
"github.com/Dreamacro/clash/component/profile/cachefile"
"github.com/Dreamacro/clash/component/resolver"
@ -171,13 +172,13 @@ func updateGeneral(general *config.General, force bool) {
resolver.DisableIPv6 = !general.IPv6
if general.Interface != "" {
dialer.DialHook = dialer.DialerWithInterface(general.Interface)
dialer.ListenPacketHook = dialer.ListenPacketWithInterface(general.Interface)
dialer.DefaultOptions = []dialer.Option{dialer.WithInterface(general.Interface)}
} else {
dialer.DialHook = nil
dialer.ListenPacketHook = nil
dialer.DefaultOptions = nil
}
iface.FlushCache()
if !force {
return
}