|
@@ -191,34 +191,24 @@ func (o *DNSServerOptions) Upgrade(ctx context.Context) error {
|
|
|
serverType = C.DNSTypeUDP
|
|
|
}
|
|
|
}
|
|
|
- var 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{
|
|
|
- DialerOptions: DialerOptions{
|
|
|
- Detour: options.Detour,
|
|
|
- DomainResolver: &DomainResolveOptions{
|
|
|
- Server: options.AddressResolver,
|
|
|
- Strategy: options.AddressStrategy,
|
|
|
- },
|
|
|
- FallbackDelay: options.AddressFallbackDelay,
|
|
|
+ remoteOptions := RemoteDNSServerOptions{
|
|
|
+ LocalDNSServerOptions: LocalDNSServerOptions{
|
|
|
+ DialerOptions: DialerOptions{
|
|
|
+ Detour: options.Detour,
|
|
|
+ DomainResolver: &DomainResolveOptions{
|
|
|
+ Server: options.AddressResolver,
|
|
|
+ Strategy: options.AddressStrategy,
|
|
|
},
|
|
|
- LegacyStrategy: options.Strategy,
|
|
|
- LegacyDefaultDialer: options.Detour == "",
|
|
|
- LegacyClientSubnet: options.ClientSubnet.Build(netip.Prefix{}),
|
|
|
+ FallbackDelay: options.AddressFallbackDelay,
|
|
|
},
|
|
|
- }
|
|
|
+ Legacy: true,
|
|
|
+ LegacyStrategy: options.Strategy,
|
|
|
+ LegacyDefaultDialer: options.Detour == "",
|
|
|
+ LegacyClientSubnet: options.ClientSubnet.Build(netip.Prefix{}),
|
|
|
+ },
|
|
|
+ LegacyAddressResolver: options.AddressResolver,
|
|
|
+ LegacyAddressStrategy: options.AddressStrategy,
|
|
|
+ LegacyAddressFallbackDelay: options.AddressFallbackDelay,
|
|
|
}
|
|
|
switch serverType {
|
|
|
case C.DNSTypeLocal:
|
|
@@ -362,6 +352,7 @@ type HostsDNSServerOptions struct {
|
|
|
|
|
|
type LocalDNSServerOptions struct {
|
|
|
DialerOptions
|
|
|
+ Legacy bool `json:"-"`
|
|
|
LegacyStrategy DomainStrategy `json:"-"`
|
|
|
LegacyDefaultDialer bool `json:"-"`
|
|
|
LegacyClientSubnet netip.Prefix `json:"-"`
|