[PR #883] [MERGED] Refactor rule direction and rename methods with in/out directions #13110

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/883
Author: @mlsmaycon
Created: 5/20/2023
Status: Merged
Merged: 5/20/2023
Merged by: @mlsmaycon

Base: feat-linux-firewall-supportHead: feat-linux-firewall-support-adjust-rules-direction


📝 Commits (5)

  • 48ea80d Use enum in proto and in out directions
  • 01c21e2 Refactor rule direction and rename methods with in/out directions
  • aead93b exit on proto all, fixed rw mutex locks
  • c37f682 add performance tests for nftables and iptables
  • 3c22006 limit create performance test to 1000 and add uspfilter test

📊 Changes

17 files changed (+780 additions, -427 deletions)

View changed files

📝 client/firewall/firewall.go (+10 -8)
📝 client/firewall/iptables/manager_linux.go (+6 -6)
📝 client/firewall/iptables/manager_linux_test.go (+39 -3)
📝 client/firewall/nftables/manager_linux.go (+4 -4)
📝 client/firewall/nftables/manager_linux_test.go (+34 -1)
📝 client/firewall/port.go (+3 -0)
📝 client/firewall/uspfilter/rule.go (+1 -1)
📝 client/firewall/uspfilter/uspfilter.go (+48 -42)
📝 client/firewall/uspfilter/uspfilter_test.go (+45 -7)
📝 client/internal/acl/manager.go (+82 -44)
📝 client/internal/acl/manager_test.go (+10 -10)
📝 iface/device_wrapper.go (+11 -11)
📝 iface/mocks/filter.go (+6 -6)
📝 management/proto/management.pb.go (+281 -114)
📝 management/proto/management.proto (+19 -3)
📝 management/server/policy.go (+38 -11)
📝 management/server/policy_test.go (+143 -156)

📄 Description

Management and proto changes:

  • Use enum in proto and in out directions
  • renamed test object IDs making more readable

Client:

  • Refactored rule direction and renamed PacketFilter methods according to in/out directions also change the mutex to use RW mutex for device wrapper .
  • Decoupled manager grpc protocol parsers and extracted add rule calls
  • Added firewall unknown action and protocol consts
  • userspace manager: exit on proto all, fixed rw mutex locks, renamed filter methods and port checks

🔄 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/883 **Author:** [@mlsmaycon](https://github.com/mlsmaycon) **Created:** 5/20/2023 **Status:** ✅ Merged **Merged:** 5/20/2023 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `feat-linux-firewall-support` ← **Head:** `feat-linux-firewall-support-adjust-rules-direction` --- ### 📝 Commits (5) - [`48ea80d`](https://github.com/netbirdio/netbird/commit/48ea80da509298b7d5e93e60cce111999d683383) Use enum in proto and in out directions - [`01c21e2`](https://github.com/netbirdio/netbird/commit/01c21e2f75f80484308f0cdd048401946c2958f5) Refactor rule direction and rename methods with in/out directions - [`aead93b`](https://github.com/netbirdio/netbird/commit/aead93b59d0b8f751c6c28195de8c774d18c3f3a) exit on proto all, fixed rw mutex locks - [`c37f682`](https://github.com/netbirdio/netbird/commit/c37f682d0107adef12a32d00f946ac25121a17b1) add performance tests for nftables and iptables - [`3c22006`](https://github.com/netbirdio/netbird/commit/3c2200605ae06529082bb8a3d7cd33d38e73433e) limit create performance test to 1000 and add uspfilter test ### 📊 Changes **17 files changed** (+780 additions, -427 deletions) <details> <summary>View changed files</summary> 📝 `client/firewall/firewall.go` (+10 -8) 📝 `client/firewall/iptables/manager_linux.go` (+6 -6) 📝 `client/firewall/iptables/manager_linux_test.go` (+39 -3) 📝 `client/firewall/nftables/manager_linux.go` (+4 -4) 📝 `client/firewall/nftables/manager_linux_test.go` (+34 -1) 📝 `client/firewall/port.go` (+3 -0) 📝 `client/firewall/uspfilter/rule.go` (+1 -1) 📝 `client/firewall/uspfilter/uspfilter.go` (+48 -42) 📝 `client/firewall/uspfilter/uspfilter_test.go` (+45 -7) 📝 `client/internal/acl/manager.go` (+82 -44) 📝 `client/internal/acl/manager_test.go` (+10 -10) 📝 `iface/device_wrapper.go` (+11 -11) 📝 `iface/mocks/filter.go` (+6 -6) 📝 `management/proto/management.pb.go` (+281 -114) 📝 `management/proto/management.proto` (+19 -3) 📝 `management/server/policy.go` (+38 -11) 📝 `management/server/policy_test.go` (+143 -156) </details> ### 📄 Description Management and proto changes: - Use enum in proto and in out directions - renamed test object IDs making more readable Client: - Refactored rule direction and renamed PacketFilter methods according to in/out directions also change the mutex to use RW mutex for device wrapper . - Decoupled manager grpc protocol parsers and extracted add rule calls - Added firewall unknown action and protocol consts - userspace manager: exit on proto all, fixed rw mutex locks, renamed filter methods and port checks --- <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:29 -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#13110