Repository navigation
fix(mac): prevent network discovery crashes on addressless interfaces - #129265
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 7:20 AM ET / 11:20 UTC. ClawSweeper reviewWhat this changesThe PR skips Darwin network-interface records without an address before extracting IPv4 data in OpenClawKit’s shared network helper. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessNo blocking correctness finding: this is a focused shared-owner repair for a current-main macOS crash path. It remains open because it is maintainer-owned and the exact-head macOS checks are still running. Priority: P1 Review scores
Verification
How this fits togetherOpenClawKit reads Darwin interface records and produces IPv4 addresses for macOS presence reporting and Tailscale discovery. Those callers select a primary address or a tailnet address from the shared enumerator’s output. flowchart LR
A[Darwin interface records] --> B[Shared IPv4 enumerator]
B --> C{Address and IPv4?}
C -->|yes| D[IPv4 address entries]
C -->|no| E[Skip interface]
D --> F[Primary address selection]
D --> G[Tailscale detection]
F --> H[Mac presence and discovery]
G --> H
Decision needed
Why: The protected maintainer label requires explicit maintainer handling; the remaining decision is ordinary exact-head validation rather than product direction. Before merge
Agent review detailsSecurityNone. PR surfaceOther 0. Total 0 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the null check in the shared enumerator and merge once the exact PR head has passed macOS validation. Do we have a high-confidence way to reproduce the issue? Yes—current main dereferences the optional Darwin address pointer before filtering the record, and the PR body describes a compiled addressless-record fixture that crashes before the fix. Is this the best way to solve the issue? Yes—the shared enumerator owns the unsafe dereference, and validating the pointer once before every address read is the narrowest maintainable repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8166cc01b94d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where the macOS application could crash while discovering network interfaces when Darwin returned a valid interface record that temporarily had no assigned address.
Why This Change Was Made
Darwin documents that
getifaddrsmay return a nullifa_addr. The existing iOS sibling already checks that contract, while the shared macOS networking owner unconditionally dereferenced it. Guard the pointer before reading the address family and reuse the verified pointer for the remaining address operations.Production delta: 4 additions / 4 deletions (net 0). No public API, configuration, protocol, authentication, persistence, or dependency changes.
User Impact
Network discovery, presence reporting, Mac connection flows, and Tailscale integration no longer crash when a VPN, virtual adapter, or transitioning interface temporarily has no assigned address.
Evidence
getifaddrsdocumentation explicitly permitsifa_addr == NULL.192.0.2.23address.swiftc -typecheckpassed for both the shared IPv4 owner and its public caller.git diff --checkpassed.