From 8877968858a8dd6b7ae096988d57a7511c81733d Mon Sep 17 00:00:00 2001 From: Giuseppe Longo Date: Mon, 10 Feb 2014 16:49:33 +0100 Subject: nft: adds save_matches_and_target This patch permits to save matches and target for ip/ip6/arp/eb family, required for xtables-events. Also, generalizes nft_rule_print_save to be reused for all protocol families. Signed-off-by: Giuseppe Longo Signed-off-by: Pablo Neira Ayuso --- iptables/nft-ipv4.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'iptables/nft-ipv4.c') diff --git a/iptables/nft-ipv4.c b/iptables/nft-ipv4.c index 3aeb8a72..02645a29 100644 --- a/iptables/nft-ipv4.c +++ b/iptables/nft-ipv4.c @@ -309,9 +309,10 @@ static void save_ipv4_addr(char letter, const struct in_addr *addr, mask_to_str(mask)); } -static uint8_t nft_ipv4_save_firewall(const struct iptables_command_state *cs, - unsigned int format) +static void nft_ipv4_save_firewall(const void *data, unsigned int format) { + const struct iptables_command_state *cs = data; + save_firewall_details(cs, cs->fw.ip.invflags, cs->fw.ip.proto, cs->fw.ip.iniface, cs->fw.ip.iniface_mask, cs->fw.ip.outiface, cs->fw.ip.outiface_mask, @@ -328,7 +329,8 @@ static uint8_t nft_ipv4_save_firewall(const struct iptables_command_state *cs, save_ipv4_addr('d', &cs->fw.ip.dst, cs->fw.ip.dmsk.s_addr, cs->fw.ip.invflags & IPT_INV_DSTIP); - return cs->fw.ip.flags; + save_matches_and_target(cs->matches, cs->target, + cs->jumpto, cs->fw.ip.flags, &cs->fw); } static void nft_ipv4_proto_parse(struct iptables_command_state *cs, -- cgit v1.2.3