Android: network-range posture checks never match because the client reports empty NetworkAddresses #7174
MichaelUray
started this conversation in
Ideas & Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What I'm trying to do
Use a
peer_network_range_checkposture check so that a device physically inside a trusted subnet (e.g. a phone on the home Wi-Fi) is treated differently from one on a foreign network — e.g. not pushing an overlay route that overlaps that local subnet.What I observe
On Linux and Windows this works: the client reports its local subnet in
NetworkAddresses, and the range check matches. On Android, the same setup never matches — the peer reports an emptyNetworkAddressesto management, so the check is effectively a no-op on Android.Root cause (as far as I can tell)
client/system/info_android.godoesn't populateNetworkAddressesthe way the other platforms do vianetworkAddresses(). On top of that,net.Interfaces()under Android'sVpnServicesandbox doesn't reliably expose the Wi-Fi IPv4 anyway, so even calling it wouldn't be enough.What I'd like your take on, before I open any PRs
NetworkAddresseson Android by reusing the existingIFaceDiscoverbridge (it already enumerates the local interfaces for ICE candidate gathering and does see the LAN addresses), rather thannet.Interfaces()?NetworkAddresseswithout a full restart. Do you have a preference between the two, or a direction you'd want this to take?I have a working prototype of both on a fork (device-verified on a real Android phone) and I'm happy to turn it into proper PRs — netbird core first, then android-client — if there's interest and agreement on the approach. I had a first, android-only attempt in netbirdio/android-client#154 (now closed) — it only covered the trigger and relied on core changes that aren't upstream, which is exactly why I'd rather align on the full approach here before opening PRs. Thanks!
All reactions