diff options
author | Phil Sutter <phil@nwl.cc> | 2018-07-19 18:31:58 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-07-19 23:05:56 +0200 |
commit | 1bf73c4227459393029ab7b124ba74fe853d9413 (patch) | |
tree | 83762e0463a355ff8ef30ad1b97a528e5fa564c7 /iptables/xtables-monitor.c | |
parent | 1866625f0befbc04673017692813f48d084004ff (diff) |
xtables: Use new callbacks in nft_rule_print_save()
This relieves callers from having to prepare iptables_command_state,
which often happens just for the sake of passing it to this function.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/xtables-monitor.c')
-rw-r--r-- | iptables/xtables-monitor.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/iptables/xtables-monitor.c b/iptables/xtables-monitor.c index e491b4db..a43a69af 100644 --- a/iptables/xtables-monitor.c +++ b/iptables/xtables-monitor.c @@ -73,7 +73,6 @@ static bool events; static int rule_cb(const struct nlmsghdr *nlh, void *data) { - struct iptables_command_state cs = {}; uint32_t type = nlh->nlmsg_type & 0xFF; const struct cb_arg *arg = data; struct nftnl_rule *r; @@ -96,19 +95,16 @@ static int rule_cb(const struct nlmsghdr *nlh, void *data) case AF_INET: case AF_INET6: printf("-%c ", family == AF_INET ? '4' : '6'); - nft_rule_to_iptables_command_state(r, &cs); break; case NFPROTO_ARP: printf("-0 "); - nft_rule_to_arptables_command_state(r, &cs); break; default: goto err_free; } printf("-t %s ", nftnl_rule_get_str(r, NFTNL_RULE_TABLE)); - nft_rule_print_save(&cs, r, - type == NFT_MSG_NEWRULE ? NFT_RULE_APPEND : + nft_rule_print_save(r, type == NFT_MSG_NEWRULE ? NFT_RULE_APPEND : NFT_RULE_DEL, counters ? 0 : FMT_NOCOUNTS); err_free: |