From 9ca32c40ed4f0648893989c1e5d03e9fecc501ae Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 9 Aug 2018 18:06:56 +0200 Subject: xtables: Don't pass full invflags to add_compat() The function expects a boolean, not a bitfield. This bug caused inversion in another match to carry over to protocol match by accident. The supplied testcase contains rules which then fail because they contain matches requiring that protocol. Fixes: 4ef77b6d1b52e ("xtables: fix missing protocol and invflags") Fixes: 4143a08819a07 ("ebtables-compat: add nft rule compat information to bridge rules") Signed-off-by: Phil Sutter --- iptables/nft-ipv6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'iptables/nft-ipv6.c') diff --git a/iptables/nft-ipv6.c b/iptables/nft-ipv6.c index fa5b8c89..c651b16d 100644 --- a/iptables/nft-ipv6.c +++ b/iptables/nft-ipv6.c @@ -60,7 +60,7 @@ static int nft_ipv6_add(struct nftnl_rule *r, void *data) &cs->fw6.ipv6.dst, &cs->fw6.ipv6.dmsk, sizeof(struct in6_addr), op); } - add_compat(r, cs->fw6.ipv6.proto, cs->fw6.ipv6.invflags); + add_compat(r, cs->fw6.ipv6.proto, cs->fw6.ipv6.invflags & XT_INV_PROTO); for (matchp = cs->matches; matchp; matchp = matchp->next) { /* Use nft built-in comments support instead of comment match */ -- cgit v1.2.3