]> git.ipfire.org Git - thirdparty/iptables.git/commit
Unbreak xtables-translate
authorPhil Sutter <phil@nwl.cc>
Sat, 6 Nov 2021 20:38:14 +0000 (21:38 +0100)
committerPhil Sutter <phil@nwl.cc>
Mon, 8 Nov 2021 11:22:36 +0000 (12:22 +0100)
commitb8d5271de4f7cc6ffeeca589ea4706e316599015
tree017901a038d1a9b6b856cbb045d4caf26d8e08ec
parent0af80a91b0a98891d3cbc891a7377281b4080035
Unbreak xtables-translate

Fixed commit broke xtables-translate which still relied upon do_parse()
to properly initialize the passed iptables_command_state reference. To
allow for callers to preset fields, this doesn't happen anymore so
do_command_xlate() has to initialize itself. Otherwise garbage from
stack is read leading to segfaults and program aborts.

Although init_cs callback is used by arptables only and
arptables-translate has not been implemented, do call it if set just to
avoid future issues.

Fixes: cfdda18044d81 ("nft-shared: Introduce init_cs family ops callback")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Tested-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/xtables-translate.c