From 217f021925872dcbce4187408762845ae3f6f182 Mon Sep 17 00:00:00 2001 From: Giuseppe Longo Date: Mon, 16 Sep 2013 10:58:16 +0200 Subject: xtables: nft-arp: implements is_same op for ARP family The following patch implements the is_same operation for ARP family needed for searching arp rule. Signed-off-by: Giuseppe Longo Signed-off-by: Pablo Neira Ayuso --- iptables/nft-ipv6.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'iptables/nft-ipv6.c') diff --git a/iptables/nft-ipv6.c b/iptables/nft-ipv6.c index 2efe95e3..3d35290f 100644 --- a/iptables/nft-ipv6.c +++ b/iptables/nft-ipv6.c @@ -49,9 +49,12 @@ static int nft_ipv6_add(struct nft_rule *r, void *data) return cs->fw6.ipv6.flags; } -static bool nft_ipv6_is_same(const struct iptables_command_state *a, - const struct iptables_command_state *b) +static bool nft_ipv6_is_same(const void *data_a, + const void *data_b) { + const struct iptables_command_state *a = data_a; + const struct iptables_command_state *b = data_b; + if (memcmp(a->fw6.ipv6.src.s6_addr, b->fw6.ipv6.src.s6_addr, sizeof(struct in6_addr)) != 0 || memcmp(a->fw6.ipv6.dst.s6_addr, b->fw6.ipv6.dst.s6_addr, -- cgit v1.2.3