]> git.ipfire.org Git - thirdparty/iptables.git/commit
xtables-restore: Introduce rule counter tokenizer function
authorPhil Sutter <phil@nwl.cc>
Tue, 17 Sep 2019 16:43:21 +0000 (18:43 +0200)
committerPhil Sutter <phil@nwl.cc>
Fri, 18 Oct 2019 09:57:24 +0000 (11:57 +0200)
commit4abb44c978d75656f69dd59f24522eb970881ccf
tree88a992be6606e03aeb378b79205d29316ca1eb7a
parentfe2c53d570bf7a301b0cb5aa25b1186a47378a6b
xtables-restore: Introduce rule counter tokenizer function

The same piece of code appears three times, introduce a function to take
care of tokenizing and error reporting.

Pass buffer pointer via reference so it can be updated to point to after
the counters (if found).

While being at it, drop pointless casting when passing pcnt/bcnt to
add_argv().

Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/iptables-restore.c
iptables/iptables-xml.c
iptables/tests/shell/testcases/ipt-restore/0008-restore-counters_0 [new file with mode: 0755]
iptables/xshared.c
iptables/xshared.h
iptables/xtables-restore.c