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 <irbe@tailscale.com>
This commit is contained in:
Irbe Krumina 2023-12-12 15:55:02 +00:00 committed by GitHub
parent d2fbdb005d
commit 0cdc8e20d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -429,7 +429,7 @@ func getOrCreateChain(c *nftables.Conn, cinfo chainInfo) (*nftables.Chain, error
return chain, nil return chain, nil
} }
_ = c.AddChain(&nftables.Chain{ chain = c.AddChain(&nftables.Chain{
Name: cinfo.name, Name: cinfo.name,
Table: cinfo.table, Table: cinfo.table,
Type: cinfo.chainType, Type: cinfo.chainType,