[client] Replace iOS DNS IsPrivate heuristic with route checker#5694
[client] Replace iOS DNS IsPrivate heuristic with route checker#5694
Conversation
5d13f1b to
3addb60
Compare
3addb60 to
3004050
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe changes introduce a route-checker callback mechanism to the DNS subsystem. The engine passes a route matcher function to the DNS server during startup, which is propagated to all upstream resolvers. DNS resolvers use this function to determine if upstream IPs match configured client routes during DNS resolution. Changes
Sequence DiagramsequenceDiagram
participant Engine
participant DNSServer as DNS Server
participant RouteManager as Route Manager
participant UpstreamResolver as Upstream Resolver
participant PrivateClient as Private Client
Engine->>DNSServer: SetRouteChecker(callback)
DNSServer->>DNSServer: Store route matcher
DNSServer->>UpstreamResolver: Propagate routeMatch
UpstreamResolver->>UpstreamResolver: Receive DNS query
UpstreamResolver->>UpstreamResolver: Determine needsPrivate flag
alt needsPrivate = true
UpstreamResolver->>RouteManager: Check if IP in routes (via callback)
RouteManager-->>UpstreamResolver: Match result
UpstreamResolver->>PrivateClient: GetClientPrivate()
PrivateClient-->>UpstreamResolver: Private client instance
UpstreamResolver->>PrivateClient: ExchangeWithFallback(query)
PrivateClient-->>UpstreamResolver: DNS response
else needsPrivate = false
UpstreamResolver->>UpstreamResolver: Use standard exchange
end
UpstreamResolver-->>Engine: DNS response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
✅ Actions performedReview triggered.
|
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |



Describe your changes
IsPrivate()heuristic in iOS upstream DNS resolver with a route checker function that queries actual client routes from the route managerSetRouteCheckerto the DNSServerinterface, wired up from the engine after route manager creationIssue ticket number and link
Stack
Checklist
Documentation
Select exactly one:
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/__
Summary by CodeRabbit