AddChain, AddRule: use table’s family

This commit is contained in:
Michael Stapelberg 2018-06-19 10:02:23 +02:00
parent 23299d6a1a
commit 0dd2e15e25
1 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,7 @@ func (cc *Conn) AddChain(c *Chain) *Chain {
Type: netlink.HeaderType((unix.NFNL_SUBSYS_NFTABLES << 8) | unix.NFT_MSG_NEWCHAIN),
Flags: netlink.HeaderFlagsRequest | netlink.HeaderFlagsAcknowledge | netlink.HeaderFlagsCreate,
},
Data: append(extraHeader(unix.AF_INET, 0), data...),
Data: append(extraHeader(uint8(c.Table.Family), 0), data...),
})
return c
@ -197,7 +197,7 @@ func (cc *Conn) AddRule(r *Rule) *Rule {
Type: netlink.HeaderType((unix.NFNL_SUBSYS_NFTABLES << 8) | unix.NFT_MSG_NEWRULE),
Flags: netlink.HeaderFlagsRequest | netlink.HeaderFlagsAcknowledge | netlink.HeaderFlagsCreate,
},
Data: append(extraHeader(unix.AF_INET, 0), data...),
Data: append(extraHeader(uint8(r.Table.Family), 0), data...),
})
return r