diff options
author | Jacek Tomasiak <jacek.tomasiak@gmail.com> | 2023-06-19 12:44:54 +0200 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2023-06-21 13:21:42 +0200 |
commit | ed839159edf8bda8e9196f1056c4038c22d78bfd (patch) | |
tree | 155b7d25cf89751840ae607484867aa89b690b46 /iptables/xshared.c | |
parent | 15919abe32092561c6318ebe2b0a9aa51e746bde (diff) |
iptables: Fix setting of ipv6 counters
When setting counters using ip6tables-nft -c X Y the X and Y values were
not stored.
This is a fix based on 9baf3bf0e77dab6ca4b167554ec0e57b65d0af01 but
applied to the nft variant of ipv6 not the legacy.
Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1647
Fixes: 0391677c1a0b2 ("xtables: add IPv6 support")
Signed-off-by: Jacek Tomasiak <jtomasiak@arista.com>
Signed-off-by: Jacek Tomasiak <jacek.tomasiak@gmail.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/xshared.c')
-rw-r--r-- | iptables/xshared.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/iptables/xshared.c b/iptables/xshared.c index a2350103..28c65fae 100644 --- a/iptables/xshared.c +++ b/iptables/xshared.c @@ -1982,6 +1982,9 @@ void ipv6_post_parse(int command, struct iptables_command_state *cs, if (args->goto_set) cs->fw6.ipv6.flags |= IP6T_F_GOTO; + /* nft-variants use cs->counters, legacy uses cs->fw6.counters */ + cs->counters.pcnt = args->pcnt_cnt; + cs->counters.bcnt = args->bcnt_cnt; cs->fw6.counters.pcnt = args->pcnt_cnt; cs->fw6.counters.bcnt = args->bcnt_cnt; |