-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Wesley Gimenes <wehagy@proton.me>
- Loading branch information
Showing
2 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
From dc3d7c7003a67e680c8d026e4ed6706b8813d706 Mon Sep 17 00:00:00 2001 | ||
From: Wesley Gimenes <wehagy@proton.me> | ||
Date: Thu, 20 Feb 2025 13:13:36 -0300 | ||
Subject: [PATCH] netbird: prefer nftables | ||
|
||
Signed-off-by: Wesley Gimenes <wehagy@proton.me> | ||
--- | ||
net/netbird/patches/0001-fix.patch | 39 ++++++++++++++++++++++++++++++ | ||
1 file changed, 39 insertions(+) | ||
create mode 100644 net/netbird/patches/0001-fix.patch | ||
|
||
diff --git a/net/netbird/patches/0001-fix.patch b/net/netbird/patches/0001-fix.patch | ||
new file mode 100644 | ||
index 000000000..dd92b738c | ||
--- /dev/null | ||
+++ b/net/netbird/patches/0001-fix.patch | ||
@@ -0,0 +1,39 @@ | ||
+diff --git a/client/firewall/create_linux.go b/client/firewall/create_linux.go | ||
+index be1b3791..2064de8a 100644 | ||
+--- a/client/firewall/create_linux.go | ||
++++ b/client/firewall/create_linux.go | ||
+@@ -109,7 +109,7 @@ func check() FWType { | ||
+ | ||
+ useIPTABLES = true | ||
+ | ||
+- iptablesChains, err = ip.ListChains("filter") | ||
++ iptablesChains, err = ip.ListChains("fw4") | ||
+ if err != nil { | ||
+ log.Errorf("failed to list iptables chains: %s", err) | ||
+ useIPTABLES = false | ||
+@@ -125,7 +125,7 @@ func check() FWType { | ||
+ // search for chains where table is filter | ||
+ // if we find one, we assume that nftables manager can be used with iptables | ||
+ for _, chain := range chains { | ||
+- if chain.Table.Name == "filter" { | ||
++ if chain.Table.Name == "fw4" { | ||
+ return NFTABLES | ||
+ } | ||
+ } | ||
+@@ -141,7 +141,7 @@ func check() FWType { | ||
+ return IPTABLES | ||
+ case err == nil && len(nbTablesList) != 1: | ||
+ return NFTABLES | ||
+- case err == nil && len(nbTablesList) == 1 && nbTablesList[0].Name == "filter": | ||
++ case err == nil && len(nbTablesList) == 1 && nbTablesList[0].Name == "fw4": | ||
+ return IPTABLES | ||
+ case err != nil: | ||
+ log.Errorf("failed to list nftables tables on fw manager discovery: %s", err) | ||
+@@ -156,6 +156,6 @@ func check() FWType { | ||
+ } | ||
+ | ||
+ func isIptablesClientAvailable(client *iptables.IPTables) bool { | ||
+- _, err := client.ListChains("filter") | ||
++ _, err := client.ListChains("fw4") | ||
+ return err == nil | ||
+ } |