]> git.ipfire.org Git - thirdparty/iptables.git/commit
extensions: ipt_DNAT: Merge v1/v2 print/save code
authorPhil Sutter <phil@nwl.cc>
Tue, 29 Mar 2022 22:11:14 +0000 (00:11 +0200)
committerPhil Sutter <phil@nwl.cc>
Fri, 8 Apr 2022 16:00:42 +0000 (18:00 +0200)
commit7adef31421bc38c068e2e30720b61dc068c0d63f
treecc7cbdec5cd6a1dcc5c6e1bc3495663cb4e6babe
parent3f4f1cf075572045a910b5c4d625602b9ba3c349
extensions: ipt_DNAT: Merge v1/v2 print/save code

Turn print_range() function into sprint_range() so it becomes more
versatile. Make it accept the new nf_nat_range2 data structure and
make v1 callers convert their nf_nat_ipv4_multi_range_compat structs
to that.
This allows to introduce an inner __DNAT_print() which acts for v1 and
v2 and prints either 'print' or 'save' syntax.

Signed-off-by: Phil Sutter <phil@nwl.cc>
extensions/libipt_DNAT.c