Skip to content

fix(network): recover managed networking after path changes - #28

Closed
Afcoo wants to merge 4 commits into
mainfrom
fix/network-path-route-recovery
Closed

fix(network): recover managed networking after path changes#28
Afcoo wants to merge 4 commits into
mainfrom
fix/network-path-route-recovery

Conversation

@Afcoo

@Afcoo Afcoo commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Summary

Recover the complete managed networking configuration after macOS network-path changes such as enabling Wi-Fi or connecting and disconnecting Ethernet.

Changes

  • Monitor macOS path changes with NWPathMonitor, ignore the initial snapshot, and coalesce bursts before checking managed networking state.
  • Check the exact four global and Bond-scoped /1 routes together with the effective primary service/interface and global DNS.
  • Keep Settings, app activation, helper health, menu status refreshes, and the initial path callback read-only.
  • Reuse the authenticated status and start XPC surface so the helper can repair the current configuration without adding a privileged operation.
  • Reapply the owned Network Service priority, Bond IPv4/DNS configuration, and sole global DNS server 192.168.100.1 when the recorded topology is still valid.
  • Refresh exact-owned or missing /1 routes while preserving unrelated routes and rejecting partial conflicts.
  • Verify the combined route, primary-service, and DNS state after repair, with rollback of service order, protocol configuration, and route state on failure.
  • Keep the latest origin/main debug routing controls and use build 22 for this distinct helper-containing update.

Related issue

None.

Validation

  • ./script/build_and_run.sh --verify
  • Checks run and unverified runtime paths are documented
    • git diff --check
    • plutil -lint for the project, property lists, and entitlements
    • xmllint --noout for shared schemes
    • jq empty for the string catalog
    • bash -n for project shell scripts
    • /Applications/Xcode-beta.app/Contents/Developer/usr/bin/xcodebuild -project ThruRNDIS.xcodeproj -scheme ThruRNDIS -configuration Debug -destination platform=macOS -derivedDataPath /tmp/ThruRNDIS-DerivedData -disableAutomaticPackageResolution CODE_SIGNING_ALLOWED=NO build
  • Signed Runtime validation with ./script/build_and_install.sh
  • Real USB/VZNAT route validation
  • Not applicable; explanation:

The app was not launched during unsigned validation. Local signing configuration and real RNDIS hardware were unavailable, so signed helper replacement and live Wi-Fi/Ethernet recovery of routes, the effective primary service, and global DNS remain unverified.

User-facing impact

While managed networking is active, ThruRNDIS now checks and restores its /1 routes, effective primary service/interface, and global DNS after macOS network-path changes. Network Routing status can briefly show Checking or Repairing. There is no new setting or layout change, so no screenshot is included.

Security and architecture

The XPC surface remains limited to status, start, and stop. The app never runs administrative networking commands. The helper repairs only the authenticated active lease and exact recorded topology, does not write configd-owned Dynamic Store State: keys, rejects conflicting routes, and never replaces or deletes unrelated network configuration.

Checklist

  • The pull request has one focused purpose.
  • The title follows Conventional Commits, for example fix(usb): serialize detach handling.
  • Behavior changes include appropriate build or runtime validation, with unavailable paths explained.
  • User-facing behavior and operational changes are documented.
  • New, moved, renamed, or deleted Swift files are reflected in Xcode groups, target membership, and build phases.
  • No credentials, provisioning profiles, personal signing values, or local build artifacts are included.
  • Guest VM scripts and VM Asset build tooling remain in Afcoo/ThruRNDIS_VM_Assets.

@chatgpt-codex-connector

This comment was marked as resolved.

@Afcoo Afcoo changed the title fix(network): recover routes after macOS path changes fix(network): recover managed networking after path changes Aug 30, 2026
@Afcoo Afcoo closed this Aug 30, 2026
@Afcoo
Afcoo deleted the fix/network-path-route-recovery branch August 30, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant