From 52f5101715e892cf12445f03e346becb33ee6c37 Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Mon, 30 Oct 2023 09:25:33 +0100 Subject: [PATCH] Fix network route adding rule to filter table (#1266) Set filterTable only for ipv4 table --- client/internal/routemanager/client.go | 2 +- client/internal/routemanager/nftables_linux.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/internal/routemanager/client.go b/client/internal/routemanager/client.go index 62fe4dfc1..fda7b012f 100644 --- a/client/internal/routemanager/client.go +++ b/client/internal/routemanager/client.go @@ -119,7 +119,7 @@ func (c *clientNetwork) getBestRouteFromStatuses(routePeerStatuses map[string]ro log.Warnf("the network %s has not been assigned a routing peer as no peers from the list %s are currently connected", c.network, peers) } else if chosen != currID { - log.Infof("new chosen route is %s with peer %s with score %d", chosen, c.routes[chosen].Peer, chosenScore) + log.Infof("new chosen route is %s with peer %s with score %d for network %s", chosen, c.routes[chosen].Peer, chosenScore, c.network) } return chosen diff --git a/client/internal/routemanager/nftables_linux.go b/client/internal/routemanager/nftables_linux.go index 25dc6e7db..d6eac96a6 100644 --- a/client/internal/routemanager/nftables_linux.go +++ b/client/internal/routemanager/nftables_linux.go @@ -135,7 +135,8 @@ func (n *nftablesManager) RestoreOrCreateContainers() error { } for _, table := range tables { - if table.Name == "filter" { + if table.Name == "filter" && table.Family == nftables.TableFamilyIPv4 { + log.Debugf("nftables: found filter table for ipv4") n.filterTable = table continue }