]> git.ipfire.org Git - thirdparty/iptables.git/commit
arptables-nft-save: Fix position of -j option
authorPhil Sutter <phil@nwl.cc>
Thu, 31 Jan 2019 15:12:54 +0000 (16:12 +0100)
committerFlorian Westphal <fw@strlen.de>
Thu, 31 Jan 2019 21:53:51 +0000 (22:53 +0100)
commit2c3f7a2cd6fd8325b3a84e280cce945c6c20b87f
tree3499067ea045ba9e7ac6c2d219a98d3401162379
parent9421327926a529ec8300d37f3be8a6cfab701786
arptables-nft-save: Fix position of -j option

Legacy arptables-save (just like arptables itself) prints verdict as
first option, then matches and finally any target options.

To achieve this without introducing double/trailing spaces everywhere,
integrate target ('-j') option printing into
nft_arp_print_rule_details() and make it print separating whitespace
before each option.

In nft_arp_save_rule(), replace the call to save_matches_and_target() by
by a direct call to cs->target->save() since the former prints '-j'
option itself. Since there are no match extensions in arptables, any
other code from that function is not needed.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
iptables/nft-arp.c
iptables/tests/shell/testcases/arptables/0001-arptables-save-restore_0
iptables/tests/shell/testcases/arptables/0002-arptables-restore-defaults_0