[PR #970] [MERGED] ACL firewall manager fix/improvement #13198

Closed
opened 2026-08-05 02:07:43 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/970
Author: @gigovich
Created: 6/19/2023
Status: Merged
Merged: 6/20/2023
Merged by: @mlsmaycon

Base: mainHead: fix-rules-squash-and-apply


📝 Commits (2)

  • c8fcaef ACL firewall manager fix/improvement
  • 46e04a3 Print log message about processed ACL rules

📊 Changes

3 files changed (+77 additions, -22 deletions)

View changed files

📝 client/firewall/port.go (+16 -0)
📝 client/internal/acl/manager.go (+48 -12)
📝 client/internal/acl/manager_test.go (+13 -10)

📄 Description

Describe your changes

Fix the issue with rule squashing, it contained an issue when calculating the total amount of IPs in the Peer map (doesn't include offline peers). That is why squashing did not work.
Also, this commit changes the rules apply behavior. Instead policy:

  1. Apply all rules from the network map
  2. Remove all previously applied rules.
    We do:
  3. Apply only new rules
  4. Remove outdated rules

Why the first variant was implemented: when you have a drop policy it is important in which order your rules are and you need a totally clean previous state to apply the new. But in the release, we didn't include a drop policy so we can do this improvement.

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)
  • Extended the README / documentation, if necessary

🔄 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/970 **Author:** [@gigovich](https://github.com/gigovich) **Created:** 6/19/2023 **Status:** ✅ Merged **Merged:** 6/20/2023 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `fix-rules-squash-and-apply` --- ### 📝 Commits (2) - [`c8fcaef`](https://github.com/netbirdio/netbird/commit/c8fcaefa078b9580dd14dc2a55629d600da6ca70) ACL firewall manager fix/improvement - [`46e04a3`](https://github.com/netbirdio/netbird/commit/46e04a33cdfc72fc25a50afdef5935bafc340030) Print log message about processed ACL rules ### 📊 Changes **3 files changed** (+77 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `client/firewall/port.go` (+16 -0) 📝 `client/internal/acl/manager.go` (+48 -12) 📝 `client/internal/acl/manager_test.go` (+13 -10) </details> ### 📄 Description ## Describe your changes Fix the issue with rule squashing, it contained an issue when calculating the total amount of IPs in the Peer map (doesn't include offline peers). That is why squashing did not work. Also, this commit changes the rules apply behavior. Instead policy: 1. Apply all rules from the network map 2. Remove all previously applied rules. We do: 1. Apply only new rules 2. Remove outdated rules Why the first variant was implemented: when you have a drop policy it is important in which order your rules are and you need a totally clean previous state to apply the new. But in the release, we didn't include a drop policy so we can do this improvement. ## Issue ticket number and link ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [x] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <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 02:07:43 -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#13198