From 1e8ef6a5847549af6fa2edc4fd642cf259ef2ba1 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 20 Aug 2019 21:41:12 +0200 Subject: nft: family_ops: Pass nft_handle to 'rule_to_cs' callback This is the actual callback used to parse nftables rules. Pass nft_handle to it so it can access the cache (and possible sets therein). Having to pass nft_handle to nft_rule_print_save() allows to simplify it a bit since no family ops lookup has to be done anymore. Signed-off-by: Phil Sutter Acked-by: Pablo Neira Ayuso --- iptables/nft-arp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'iptables/nft-arp.c') diff --git a/iptables/nft-arp.c b/iptables/nft-arp.c index da22c12d..d4a86610 100644 --- a/iptables/nft-arp.c +++ b/iptables/nft-arp.c @@ -590,7 +590,7 @@ nft_arp_print_rule(struct nft_handle *h, struct nftnl_rule *r, if (format & FMT_LINENUMBERS) printf("%u ", num); - nft_rule_to_iptables_command_state(r, &cs); + nft_rule_to_iptables_command_state(h, r, &cs); nft_arp_print_rule_details(&cs, format); print_matches_and_target(&cs, format); @@ -641,7 +641,7 @@ static bool nft_arp_rule_find(struct nft_handle *h, struct nftnl_rule *r, bool ret = false; /* Delete by matching rule case */ - nft_rule_to_iptables_command_state(r, &this); + nft_rule_to_iptables_command_state(h, r, &this); if (!nft_arp_is_same(&cs->arp, &this.arp)) goto out; -- cgit v1.2.3