Kaynağa Gözat

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 <[email protected]>
Irbe Krumina 2 yıl önce
ebeveyn
işleme
0cdc8e20d6
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      util/linuxfw/nftables_runner.go

+ 1 - 1
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,