-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[client] Fix iOS DNS upstream routing for deselected exit nodes #5803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4a10159
Add support for configuring custom DNS hosts on iOS
mlsmaycon a0b26e4
Add detailed logging for iOS DNS and route management
mlsmaycon 63857b1
remove debug logs
mlsmaycon f08e445
Update iOS client DNS servers to Quad9 for improved privacy
mlsmaycon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -161,7 +161,11 @@ func (c *Client) Run(fd int32, interfaceName string, envList *EnvList) error { | |
| cfg.WgIface = interfaceName | ||
|
|
||
| c.connectClient = internal.NewConnectClient(ctx, cfg, c.recorder) | ||
| return c.connectClient.RunOniOS(fd, c.networkChangeListener, c.dnsManager, c.stateFile) | ||
| hostDNS := []netip.AddrPort{ | ||
| netip.MustParseAddrPort("9.9.9.9:53"), | ||
| netip.MustParseAddrPort("149.112.112.112:53"), | ||
| } | ||
| return c.connectClient.RunOniOS(fd, c.networkChangeListener, c.dnsManager, hostDNS, c.stateFile) | ||
|
Comment on lines
+164
to
+168
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add IPv6 fallback resolvers for iOS host DNS. Line 164 configures only IPv4 upstreams. On IPv6-only networks, fallback DNS can fail and leave unmatched queries unresolved. 🔧 Proposed fix hostDNS := []netip.AddrPort{
netip.MustParseAddrPort("1.1.1.1:53"),
netip.MustParseAddrPort("1.0.0.1:53"),
+ netip.MustParseAddrPort("[2606:4700:4700::1111]:53"),
+ netip.MustParseAddrPort("[2606:4700:4700::1001]:53"),
}🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| // Stop the internal client and free the resources | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Root fallback handler is created too early for route-aware upstream routing.
At Line 198,
addHostRootZone()runs before the engine injectsSetRouteChecker(...). The handler snapshotss.routeMatchat creation, so it can stayniland skip selected-route matching.🔧 Proposed fix (outside this hunk, in
SetRouteChecker)func (s *DefaultServer) SetRouteChecker(f func(netip.Addr) bool) { s.mux.Lock() defer s.mux.Unlock() s.routeMatch = f + if s.permanent { + s.deregisterHandler([]string{nbdns.RootZone}, PriorityDefault) + s.addHostRootZone() + } }🤖 Prompt for AI Agents