[PR #2430] [MERGED] Handle route expansion on client #15125

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/2430
Author: @lixmal
Created: 8/14/2024
Status: Merged
Merged: 9/27/2024
Merged by: @lixmal

Base: feature/network-route-access-controlHead: handle-route-expansion-client


📝 Commits (10+)

  • b4eedd4 Split IPv4 and IPv6 rules
  • 14d1901 Prepare for multiple sources
  • e51f2f2 Make ref counter more generic
  • 5e63dbd Use ipsets for nftables
  • 50307ec Add ipsets to iptables router
  • aea103d Rewrite nftables using refcounter
  • 443ff16 Fix iptables test
  • 0d0d61b Fix nftables test
  • 453f936 Add nftables set creation
  • 5a208ea Fix overlapping ranges by merging them

📊 Changes

22 files changed (+1013 additions, -223 deletions)

View changed files

📝 .github/workflows/golangci-lint.yml (+1 -1)
📝 client/firewall/iptables/manager_linux.go (+3 -3)
📝 client/firewall/iptables/router_linux.go (+127 -32)
📝 client/firewall/iptables/router_linux_test.go (+56 -18)
📝 client/firewall/manager/firewall.go (+60 -9)
client/firewall/manager/firewall_test.go (+192 -0)
📝 client/firewall/nftables/acl_linux.go (+1 -1)
📝 client/firewall/nftables/manager_linux.go (+3 -11)
📝 client/firewall/nftables/router_linux.go (+169 -28)
📝 client/firewall/nftables/router_linux_test.go (+209 -24)
📝 client/firewall/uspfilter/uspfilter.go (+2 -10)
📝 client/internal/acl/id/id.go (+2 -10)
📝 client/internal/acl/manager.go (+15 -6)
📝 client/internal/routemanager/dynamic/route.go (+1 -1)
📝 client/internal/routemanager/manager.go (+3 -3)
📝 client/internal/routemanager/refcounter/refcounter.go (+144 -55)
📝 client/internal/routemanager/refcounter/types.go (+4 -2)
📝 client/internal/routemanager/static/route.go (+1 -1)
📝 client/internal/routemanager/systemops/systemops.go (+1 -1)
📝 client/internal/routemanager/systemops/systemops_generic.go (+2 -2)

...and 2 more files

📄 Description

Describe your changes

  • Handle mgmt server handing out sources instead of single source
  • Adds ipset to iptables and sets for nftables when len(sources) > 1
  • Make refcounter more generic for that purpose

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/2430 **Author:** [@lixmal](https://github.com/lixmal) **Created:** 8/14/2024 **Status:** ✅ Merged **Merged:** 9/27/2024 **Merged by:** [@lixmal](https://github.com/lixmal) **Base:** `feature/network-route-access-control` ← **Head:** `handle-route-expansion-client` --- ### 📝 Commits (10+) - [`b4eedd4`](https://github.com/netbirdio/netbird/commit/b4eedd405637e4012665ac681f3a2a7e716e0dab) Split IPv4 and IPv6 rules - [`14d1901`](https://github.com/netbirdio/netbird/commit/14d19010c96f6d3f86bccc2bb75dae76390598ac) Prepare for multiple sources - [`e51f2f2`](https://github.com/netbirdio/netbird/commit/e51f2f25828ad40376fbda535628a05bc43a48cf) Make ref counter more generic - [`5e63dbd`](https://github.com/netbirdio/netbird/commit/5e63dbd0db02cc7a1cc567546051e971102c50f9) Use ipsets for nftables - [`50307ec`](https://github.com/netbirdio/netbird/commit/50307ec8ad5e2ea629754926fdc1c264c6d9f912) Add ipsets to iptables router - [`aea103d`](https://github.com/netbirdio/netbird/commit/aea103d1fd0af39b1a4ae6e87cbf7202349a4809) Rewrite nftables using refcounter - [`443ff16`](https://github.com/netbirdio/netbird/commit/443ff16676288adc81cca580dcdae24b6752c59e) Fix iptables test - [`0d0d61b`](https://github.com/netbirdio/netbird/commit/0d0d61b53a631b6d70fbd0275d4ca3a5be468bb9) Fix nftables test - [`453f936`](https://github.com/netbirdio/netbird/commit/453f9368a8698e163453fc3fb88e5def233299e4) Add nftables set creation - [`5a208ea`](https://github.com/netbirdio/netbird/commit/5a208eaaf3795e611183b9bae3ab0a3360e1c916) Fix overlapping ranges by merging them ### 📊 Changes **22 files changed** (+1013 additions, -223 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/golangci-lint.yml` (+1 -1) 📝 `client/firewall/iptables/manager_linux.go` (+3 -3) 📝 `client/firewall/iptables/router_linux.go` (+127 -32) 📝 `client/firewall/iptables/router_linux_test.go` (+56 -18) 📝 `client/firewall/manager/firewall.go` (+60 -9) ➕ `client/firewall/manager/firewall_test.go` (+192 -0) 📝 `client/firewall/nftables/acl_linux.go` (+1 -1) 📝 `client/firewall/nftables/manager_linux.go` (+3 -11) 📝 `client/firewall/nftables/router_linux.go` (+169 -28) 📝 `client/firewall/nftables/router_linux_test.go` (+209 -24) 📝 `client/firewall/uspfilter/uspfilter.go` (+2 -10) 📝 `client/internal/acl/id/id.go` (+2 -10) 📝 `client/internal/acl/manager.go` (+15 -6) 📝 `client/internal/routemanager/dynamic/route.go` (+1 -1) 📝 `client/internal/routemanager/manager.go` (+3 -3) 📝 `client/internal/routemanager/refcounter/refcounter.go` (+144 -55) 📝 `client/internal/routemanager/refcounter/types.go` (+4 -2) 📝 `client/internal/routemanager/static/route.go` (+1 -1) 📝 `client/internal/routemanager/systemops/systemops.go` (+1 -1) 📝 `client/internal/routemanager/systemops/systemops_generic.go` (+2 -2) _...and 2 more files_ </details> ### 📄 Description ## Describe your changes - Handle mgmt server handing out sources instead of single source - Adds ipset to iptables and sets for nftables when `len(sources) > 1` - Make refcounter more generic for that purpose ## Issue ticket number and link ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [x] It is a refactor - [x] 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 03:07:02 -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#15125