From 0cdc8e20d6151873d63c38f885cf473324111e35 Mon Sep 17 00:00:00 2001 From: Irbe Krumina Date: Tue, 12 Dec 2023 15:55:02 +0000 Subject: [PATCH] util/linuxfw: return created chain (#10563) Ensure that if getOrCreateChain creates a new chain, it actually returns the created chain Updates tailscale/tailscale#10399 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 7e7d80ca6..3092b08b5 100644 --- a/util/linuxfw/nftables_runner.go +++ b/util/linuxfw/nftables_runner.go @@ -429,7 +429,7 @@ func getOrCreateChain(c *nftables.Conn, cinfo chainInfo) (*nftables.Chain, error return chain, nil } - _ = c.AddChain(&nftables.Chain{ + chain = c.AddChain(&nftables.Chain{ Name: cinfo.name, Table: cinfo.table, Type: cinfo.chainType,