]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests: netfilter: nft_fib.sh: add 'type' mode tests
authorFlorian Westphal <fw@strlen.de>
Wed, 21 May 2025 09:38:45 +0000 (11:38 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 22 May 2025 15:16:02 +0000 (17:16 +0200)
commit839340f7c7bb9a83b95bdf1abbef6dff990e35f5
tree2695ff94f64c0b6698689e2e648170348848f78e
parentc38eb2973c18d34a8081d173a6ad298461f4a37c
selftests: netfilter: nft_fib.sh: add 'type' mode tests

fib can either lookup the interface id/name of the output interface that
would be used for the given address, or it can check for the type of the
address according to the fib, e.g. local, unicast, multicast and so on.

This can be used to e.g. make a locally configured address only reachable
through its interface.

Example: given eth0:10.1.1.1 and eth1:10.1.2.1 then 'fib daddr type' for
10.1.1.1 arriving on eth1 will be 'local', but 'fib daddr . iif type' is
expected to return 'unicast', whereas 'fib daddr' and 'fib daddr . iif'
are expected to indicate 'local' if such a packet arrives on eth0.

So far nft_fib.sh only covered oif/oifname, not type.

Repeat tests both with default and a policy (ip rule) based setup.

Also try to run all remaining tests even if a subtest has failed.

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