From 1fbaf26106ef485b6f54a3417e66888d63109e22 Mon Sep 17 00:00:00 2001 From: Irbe Krumina Date: Fri, 5 Apr 2024 19:43:58 +0100 Subject: [PATCH] util/linuxfw: fix chain comparison (#11639) Don't compare pointer fields by pointer value, but by the actual value Updates#cleanup Signed-off-by: Irbe Krumina --- util/linuxfw/nftables_runner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/linuxfw/nftables_runner.go b/util/linuxfw/nftables_runner.go index 7cfd0c5c7..144a9d942 100644 --- a/util/linuxfw/nftables_runner.go +++ b/util/linuxfw/nftables_runner.go @@ -447,7 +447,7 @@ func getOrCreateChain(c *nftables.Conn, cinfo chainInfo) (*nftables.Chain, error // type/hook/priority, but for "conventional chains" assume they're what // we expect (in case iptables-nft/ufw make minor behavior changes in // the future). - if isTSChain(chain.Name) && (chain.Type != cinfo.chainType || chain.Hooknum != cinfo.chainHook || chain.Priority != cinfo.chainPriority) { + if isTSChain(chain.Name) && (chain.Type != cinfo.chainType || *chain.Hooknum != *cinfo.chainHook || *chain.Priority != *cinfo.chainPriority) { return nil, fmt.Errorf("chain %s already exists with different type/hook/priority", cinfo.name) } return chain, nil