[client] Fix uspfilter duplicate firewall rules#5269
Conversation
📝 WalkthroughWalkthroughIntroduces route rule deduplication via a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
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 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 |
|



Describe your changes
When the ACL manager receives network map updates, it re-applies firewall rules.
In uspfilter, each call to
addRouteFilteringpreviously generated a new UUID for the rule ID, meaning re-adding the same logical rule created a duplicate entry in the routeRules slice.Similarly,
blockInvalidRouted(called fromEnableRouting) accumulated duplicate block rules on each invocation. Over time, this would cause unbounded growth of the route rules slice.Issue ticket number and link
Stack
Checklist
Documentation
Select exactly one:
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
Bug Fixes
Performance
Tests