From 9be7e33a07b501799581d77949a2607fab5bb7c9 Mon Sep 17 00:00:00 2001 From: Zoltan Papp Date: Thu, 4 Jan 2024 09:26:06 +0100 Subject: [PATCH] Remove dst expression from routeing rules --- client/firewall/nftables/route_linux.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/client/firewall/nftables/route_linux.go b/client/firewall/nftables/route_linux.go index 381136e50..e49b74271 100644 --- a/client/firewall/nftables/route_linux.go +++ b/client/firewall/nftables/route_linux.go @@ -179,14 +179,11 @@ func (r *router) InsertRoutingRules(pair manager.RouterPair) error { // insertRoutingRule inserts a nftable rule to the conn client flush queue func (r *router) insertRoutingRule(format, chainName string, pair manager.RouterPair, isNat bool) error { - sourceExp := generateCIDRMatcherExpressions(true, pair.Source) - destExp := generateCIDRMatcherExpressions(false, pair.Destination) - - var expression []expr.Any + expression := generateCIDRMatcherExpressions(true, pair.Source) if isNat { - expression = append(sourceExp, append(destExp, &expr.Counter{}, &expr.Masq{})...) // nolint:gocritic + expression = append(expression, &expr.Counter{}, &expr.Masq{}) // nolint:gocritic } else { - expression = append(sourceExp, append(destExp, exprCounterAccept...)...) // nolint:gocritic + expression = append(expression, exprCounterAccept...) // nolint:gocritic } ruleKey := manager.GenKey(format, pair.ID)