mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-06-13 21:54:13 +08:00
Fix DNS upgrade
This commit is contained in:
parent
940665fc3e
commit
786d17cb6a
@ -191,20 +191,7 @@ func (o *DNSServerOptions) Upgrade(ctx context.Context) error {
|
|||||||
serverType = C.DNSTypeUDP
|
serverType = C.DNSTypeUDP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var remoteOptions RemoteDNSServerOptions
|
remoteOptions := RemoteDNSServerOptions{
|
||||||
if options.Detour == "" {
|
|
||||||
remoteOptions = RemoteDNSServerOptions{
|
|
||||||
LocalDNSServerOptions: LocalDNSServerOptions{
|
|
||||||
LegacyStrategy: options.Strategy,
|
|
||||||
LegacyDefaultDialer: options.Detour == "",
|
|
||||||
LegacyClientSubnet: options.ClientSubnet.Build(netip.Prefix{}),
|
|
||||||
},
|
|
||||||
LegacyAddressResolver: options.AddressResolver,
|
|
||||||
LegacyAddressStrategy: options.AddressStrategy,
|
|
||||||
LegacyAddressFallbackDelay: options.AddressFallbackDelay,
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
remoteOptions = RemoteDNSServerOptions{
|
|
||||||
LocalDNSServerOptions: LocalDNSServerOptions{
|
LocalDNSServerOptions: LocalDNSServerOptions{
|
||||||
DialerOptions: DialerOptions{
|
DialerOptions: DialerOptions{
|
||||||
Detour: options.Detour,
|
Detour: options.Detour,
|
||||||
@ -218,7 +205,9 @@ func (o *DNSServerOptions) Upgrade(ctx context.Context) error {
|
|||||||
LegacyDefaultDialer: options.Detour == "",
|
LegacyDefaultDialer: options.Detour == "",
|
||||||
LegacyClientSubnet: options.ClientSubnet.Build(netip.Prefix{}),
|
LegacyClientSubnet: options.ClientSubnet.Build(netip.Prefix{}),
|
||||||
},
|
},
|
||||||
}
|
LegacyAddressResolver: options.AddressResolver,
|
||||||
|
LegacyAddressStrategy: options.AddressStrategy,
|
||||||
|
LegacyAddressFallbackDelay: options.AddressFallbackDelay,
|
||||||
}
|
}
|
||||||
switch serverType {
|
switch serverType {
|
||||||
case C.DNSTypeLocal:
|
case C.DNSTypeLocal:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user