Set DNS matchDomains when include routes have no default route

Without this, the system ignores the NE's DNS server when IPv4
include routes don't contain 0.0.0.0/0 (e.g. segment routing).
Only applied conditionally to avoid breaking macOS Internet Sharing.
This commit is contained in:
世界
2026-03-11 17:53:46 +08:00
parent efa6088884
commit f9fa896326
3 changed files with 14 additions and 5 deletions
@@ -146,6 +146,14 @@ public class ExtensionPlatformInterface: NSObject, LibboxPlatformInterfaceProtoc
ipv6Settings.includedRoutes = ipv6Routes
ipv6Settings.excludedRoutes = ipv6ExcludeRoutes
settings.ipv6Settings = ipv6Settings
let hasDefaultRoute = ipv4Routes.contains(where: {
$0.destinationAddress == "0.0.0.0" && $0.destinationSubnetMask == "0.0.0.0"
})
if !hasDefaultRoute {
dnsSettings.matchDomains = [""]
dnsSettings.matchDomainsNoSearch = true
}
}
if options.isHTTPProxyEnabled() {