summaryrefslogtreecommitdiffstats
path: root/iptables/xshared.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2021-11-04 15:42:16 +0100
committerPhil Sutter <phil@nwl.cc>2022-01-12 14:10:02 +0100
commit9baf3bf0e77dab6ca4b167554ec0e57b65d0af01 (patch)
treef72dc2b01aa7bf74ffb3e8a7b85aa7615f6134cd /iptables/xshared.c
parente4f5185d8f29a8d5b62159cb361648acd55da2a6 (diff)
iptables: Use xtables' do_parse() function
To do so, a few conversions are needed: - Make use of xt_params->optstring - Make use of xt_params->print_help callback - Switch to using a proto_parse callback Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/xshared.c')
-rw-r--r--iptables/xshared.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/iptables/xshared.c b/iptables/xshared.c
index a3985d45..8d94fcd5 100644
--- a/iptables/xshared.c
+++ b/iptables/xshared.c
@@ -1864,8 +1864,11 @@ void ipv4_post_parse(int command, struct iptables_command_state *cs,
if (args->goto_set)
cs->fw.ip.flags |= IPT_F_GOTO;
+ /* nft-variants use cs->counters, legacy uses cs->fw.counters */
cs->counters.pcnt = args->pcnt_cnt;
cs->counters.bcnt = args->bcnt_cnt;
+ cs->fw.counters.pcnt = args->pcnt_cnt;
+ cs->fw.counters.bcnt = args->bcnt_cnt;
if (command & (CMD_REPLACE | CMD_INSERT |
CMD_DELETE | CMD_APPEND | CMD_CHECK)) {