From 04ff786c7a42f3ad16535fa5d7aa20346217917b Mon Sep 17 00:00:00 2001 From: Arturo Borrero Date: Sat, 8 Nov 2014 22:40:37 +0100 Subject: nft-bridge: fix printing of inverted protocols, addresses Previous to this patch, no '!' is printed in payload comparisions. This patch solves it, so we can print for example inverted protocols: % ebtables-compat -L [...] -p ! 0x800 -j ACCEPT Signed-off-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- iptables/nft-bridge.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/iptables/nft-bridge.c b/iptables/nft-bridge.c index 0e21b468..3ed62398 100644 --- a/iptables/nft-bridge.c +++ b/iptables/nft-bridge.c @@ -268,15 +268,21 @@ static void nft_bridge_parse_payload(struct nft_xt_ctx *ctx, get_cmp_data(e, addr, sizeof(addr), &inv); for (i = 0; i < ETH_ALEN; i++) fw->destmac[i] = addr[i]; + if (inv) + fw->invflags |= EBT_IDEST; break; case offsetof(struct ethhdr, h_source): get_cmp_data(e, addr, sizeof(addr), &inv); for (i = 0; i < ETH_ALEN; i++) fw->sourcemac[i] = addr[i]; + if (inv) + fw->invflags |= EBT_ISOURCE; break; case offsetof(struct ethhdr, h_proto): get_cmp_data(e, ðproto, sizeof(ethproto), &inv); fw->ethproto = ethproto; + if (inv) + fw->invflags |= EBT_IPROTO; break; } } -- cgit v1.2.3