From 0dd2e15e25179664fd0916997d71f2e0b1e181fc Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 19 Jun 2018 10:02:23 +0200 Subject: [PATCH] =?UTF-8?q?AddChain,=20AddRule:=20use=20table=E2=80=99s=20?= =?UTF-8?q?family?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nftables.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nftables.go b/nftables.go index 7af963b..8510809 100644 --- a/nftables.go +++ b/nftables.go @@ -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