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 <irbe@tailscale.com>
This commit is contained in:
parent
8c75da27fc
commit
1fbaf26106
|
@ -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
|
// type/hook/priority, but for "conventional chains" assume they're what
|
||||||
// we expect (in case iptables-nft/ufw make minor behavior changes in
|
// we expect (in case iptables-nft/ufw make minor behavior changes in
|
||||||
// the future).
|
// 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 nil, fmt.Errorf("chain %s already exists with different type/hook/priority", cinfo.name)
|
||||||
}
|
}
|
||||||
return chain, nil
|
return chain, nil
|
||||||
|
|
Loading…
Reference in New Issue