]> git.ipfire.org Git - thirdparty/iptables.git/commit
extensions: libipt_icmp: Fix translation of type 'any'
authorPhil Sutter <phil@nwl.cc>
Tue, 6 Oct 2020 17:07:19 +0000 (19:07 +0200)
committerPhil Sutter <phil@nwl.cc>
Tue, 6 Oct 2020 19:50:51 +0000 (21:50 +0200)
commitad4b17b98bbedf93d2182a4dc9a37e9cf3adfe1b
tree0e4fa74a5964fb7e52f1853c9ef9bfebbc8fcb0e
parent72ed608bf1ea550ac13b5b880afc7ad3ffa0afd0
extensions: libipt_icmp: Fix translation of type 'any'

By itself, '-m icmp --icmp-type any' is a noop, it matches any icmp
types. Yet nft_ipv4_xlate() does not emit an 'ip protocol' match if
there's an extension with same name present in the rule. Luckily, legacy
iptables demands icmp match to be prepended by '-p icmp', so we can
assume this is present and just emit the 'ip protocol' match from icmp
xlate callback.

Fixes: aa158ca0fda65 ("extensions: libipt_icmp: Add translation to nft")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Reviewed-by: Florian Westphal <fw@strlen.de>
extensions/libipt_icmp.c
extensions/libipt_icmp.txlate