[client] Skip down interfaces in network address collection for posture checks#5768
[client] Skip down interfaces in network address collection for posture checks#5768
Conversation
📝 WalkthroughWalkthroughNetwork interface filtering logic was enhanced across two files. One file added TODO comments noting future filtering improvements, while another implemented a check to skip network interfaces that are not in the "up" state before further processing. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
client/firewall/uspfilter/localip.go (1)
147-148: Consider linking this TODO to a concrete tracking issue.Nice callout of the gap. To avoid this getting lost, include an issue/PR reference directly in the TODO (for example, “TODO(
#1743or follow-up issue): ...”).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@client/firewall/uspfilter/localip.go` around lines 147 - 148, The TODO in localip.go noting "filter out down interfaces (net.FlagUp)..." should include a concrete tracking reference so it isn't lost; update that comment (near the logic that refreshes interface list in the functions handling local IP discovery, e.g., the code block around the refresh/filter logic in localip.go) to read something like "TODO(#<issue-number>): filter out down interfaces (net.FlagUp) and handle interfaces coming up between refreshes" or reference the PR number you create, replacing <issue-number> with the actual issue/PR ID.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@client/firewall/uspfilter/localip.go`:
- Around line 147-148: The TODO in localip.go noting "filter out down interfaces
(net.FlagUp)..." should include a concrete tracking reference so it isn't lost;
update that comment (near the logic that refreshes interface list in the
functions handling local IP discovery, e.g., the code block around the
refresh/filter logic in localip.go) to read something like
"TODO(#<issue-number>): filter out down interfaces (net.FlagUp) and handle
interfaces coming up between refreshes" or reference the PR number you create,
replacing <issue-number> with the actual issue/PR ID.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 74b87413-d733-48f3-848e-f3102716980f
📒 Files selected for processing (2)
client/firewall/uspfilter/localip.goclient/system/info.go



Describe your changes
The
networkAddresses()function inclient/system/info.goreports IPs from all interfaces regardless of state. On Windows, disconnected adapters retain stale DHCP addresses, so the "Peer Network Range" posture check matches those addresses against deny rules and blocks the peer entirely (0 peers, 0 routes).net.FlagUpbefore collecting addresses for peer system metadatalocalip.gowhich has the same issue independentlyIssue ticket number and link
#1743
Stack
Checklist
Documentation
Select exactly one:
No user-facing behavior change in docs, the client simply stops reporting addresses from down interfaces.
Summary by CodeRabbit
Bug Fixes
Chores