kselftests: extend nft_nat with inet family based nat hooks
authorFlorian Westphal <fw@strlen.de>
Wed, 27 Mar 2019 08:22:29 +0000 (09:22 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 8 Apr 2019 21:03:04 +0000 (23:03 +0200)
commit6978cdb129da13f46bcc4362639ba5ee8fc82921
treed82946a8cb650c41a7b37f58d3b59d5cd9f573d4
parent63ce3940f3ab1d81e7c6d310dba52aed85db6aa1
kselftests: extend nft_nat with inet family based nat hooks

With older nft versions, this will cause:
[..]
PASS: ipv6 ping to ns1 was ip6 NATted to ns2
/dev/stdin:4:30-31: Error: syntax error, unexpected to, expecting newline or semicolon
                ip daddr 10.0.1.99 dnat ip to 10.0.2.99
                                           ^^
SKIP: inet nat tests
PASS: ip IP masquerade for ns2
[..]

as there is currently no way to detect if nft will be able to parse
the inet format.

redirect and masquerade tests need to be skipped in this case for inet
too because nft userspace has overzealous family check and rejects their
use in the inet family.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tools/testing/selftests/netfilter/nft_nat.sh