[client] Populate NetworkAddresses on iOS for posture checks#5900
[client] Populate NetworkAddresses on iOS for posture checks#5900pappz merged 1 commit intonetbirdio:mainfrom
Conversation
📝 WalkthroughWalkthroughThe iOS Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
The iOS GetInfo() function never populated NetworkAddresses, causing the peer_network_range_check posture check to fail for all iOS clients. This adds the same networkAddresses() call that macOS, Linux, Windows, and FreeBSD already use. Fixes: netbirdio#3968 Fixes: netbirdio#4657
268fc99 to
46733dc
Compare
|
Upstream netbirdio#5900 added networkAddresses() to info_ios.go. Since this PR updates the networkAddresses() signature to require context (for the Android external iface discoverer), the iOS caller needs the same ctx argument.



Summary
The iOS
GetInfo()function never populatedNetworkAddresses, causing thepeer_network_range_checkposture check to fail for all iOS clients. The management server received emptyNetworkAddressesand either blocked the peer entirely or could not evaluate network-based policies.This adds the same
networkAddresses()call that macOS, Linux, Windows, and FreeBSD already use. The function is available in the sharedinfo.goand works on iOS vianet.Interfaces().Changes
client/system/info_ios.go: CallnetworkAddresses()and populateNetworkAddressesfield in theInfostruct, matching the pattern used by all other platformsRelated Issues
Fixes #3968 — Posture checks peer network range failed on iPhone
Fixes #4657 — iOS Client loses all routes when Posture Checks are enabled
Testing
This change cannot be tested without macOS + Xcode. However:
networkAddresses()function is already compiled into the iOS binary (sharedinfo.go)net.Interfaces()is available on iOS and returns interface information within the Network Extension sandboxChecklist
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
New Features
Bug Fixes