[PR #5900] [MERGED] [client] Populate NetworkAddresses on iOS for posture checks #28725

Closed
opened 2026-08-05 08:06:50 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/5900
Author: @MichaelUray
Created: 4/16/2026
Status: Merged
Merged: 4/16/2026
Merged by: @pappz

Base: mainHead: fix/ios-network-addresses


📝 Commits (1)

  • 46733dc fix(client): populate NetworkAddresses on iOS for posture checks

📊 Changes

1 file changed (+18 additions, -3 deletions)

View changed files

📝 client/system/info_ios.go (+18 -3)

📄 Description

Summary

The iOS GetInfo() function never populated NetworkAddresses, causing the peer_network_range_check posture check to fail for all iOS clients. The management server received empty NetworkAddresses and 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 shared info.go and works on iOS via net.Interfaces().

Changes

  • client/system/info_ios.go: Call networkAddresses() and populate NetworkAddresses field in the Info struct, matching the pattern used by all other platforms

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:

  • The networkAddresses() function is already compiled into the iOS binary (shared info.go)
  • The same function works correctly on macOS, Linux, Windows, FreeBSD, and Android
  • net.Interfaces() is available on iOS and returns interface information within the Network Extension sandbox

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

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

    • Network address detection now available for iOS devices
  • Bug Fixes

    • Corrected platform reference in code documentation
    • Enhanced error handling for network discovery processes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/5900 **Author:** [@MichaelUray](https://github.com/MichaelUray) **Created:** 4/16/2026 **Status:** ✅ Merged **Merged:** 4/16/2026 **Merged by:** [@pappz](https://github.com/pappz) **Base:** `main` ← **Head:** `fix/ios-network-addresses` --- ### 📝 Commits (1) - [`46733dc`](https://github.com/netbirdio/netbird/commit/46733dcdbfc94cd96da512a9e0a7441a582051e8) fix(client): populate NetworkAddresses on iOS for posture checks ### 📊 Changes **1 file changed** (+18 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `client/system/info_ios.go` (+18 -3) </details> ### 📄 Description ## Summary The iOS `GetInfo()` function never populated `NetworkAddresses`, causing the `peer_network_range_check` posture check to fail for all iOS clients. The management server received empty `NetworkAddresses` and 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 shared `info.go` and works on iOS via `net.Interfaces()`. ## Changes - `client/system/info_ios.go`: Call `networkAddresses()` and populate `NetworkAddresses` field in the `Info` struct, matching the pattern used by all other platforms ## Related 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: - The `networkAddresses()` function is already compiled into the iOS binary (shared `info.go`) - The same function works correctly on macOS, Linux, Windows, FreeBSD, and Android - `net.Interfaces()` is available on iOS and returns interface information within the Network Extension sandbox ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) ### 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/__ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Network address detection now available for iOS devices * **Bug Fixes** * Corrected platform reference in code documentation * Enhanced error handling for network discovery processes <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 08:06:50 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#28725