From e2a2c72277b49ac611809b3978365ab3010e1597 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 18 Sep 2013 14:13:47 +0200 Subject: nft: consolidate nft_rule_find for ARP, IPv4 and IPv6 This patch kills nft_arp_rule_find, which is almost a copy and paste of the original nft_rule_find function. Refactor this function to move specific protocol parts to the corresponding nft-{ipv4,ipv6,arp}.c files. Signed-off-by: Pablo Neira Ayuso --- iptables/nft-ipv4.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'iptables/nft-ipv4.c') diff --git a/iptables/nft-ipv4.c b/iptables/nft-ipv4.c index 71fbc830..2142a2e6 100644 --- a/iptables/nft-ipv4.c +++ b/iptables/nft-ipv4.c @@ -371,6 +371,14 @@ static void nft_ipv4_parse_target(struct xtables_target *t, void *data) cs->target = t; } +static bool nft_ipv4_rule_find(struct nft_family_ops *ops, + struct nft_rule *r, void *data) +{ + struct iptables_command_state *cs = data; + + return nft_ipv46_rule_find(ops, r, cs); +} + struct nft_family_ops nft_family_ops_ipv4 = { .add = nft_ipv4_add, .is_same = nft_ipv4_is_same, @@ -381,4 +389,5 @@ struct nft_family_ops nft_family_ops_ipv4 = { .save_firewall = nft_ipv4_save_firewall, .post_parse = nft_ipv4_post_parse, .parse_target = nft_ipv4_parse_target, + .rule_find = nft_ipv4_rule_find, }; -- cgit v1.2.3