]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nft_fib: reverse path filter for policy-based routing on iif
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 31 Mar 2022 15:14:47 +0000 (17:14 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 11 Apr 2022 10:10:09 +0000 (12:10 +0200)
commitddb9dead1cb1eb07e32bb95443364672610bbcc5
tree616dbe02d237e9712e8ceb3a9c46ba26f99247e5
parenta525320794d3e5716c8c42d4424c774da177709b
netfilter: nft_fib: reverse path filter for policy-based routing on iif

If policy-based routing using the iif selector is used, then the fib
expression fails to look up for the reverse path from the prerouting
hook because the input interface cannot be inferred. In order to support
this scenario, extend the fib expression to allow to use after the route
lookup, from the forward hook.

This patch also adds support for the input hook for usability reasons.
Since the prerouting hook cannot be used for the scenario described
above, users need two rules: one for the forward chain and another rule
for the input chain to check for the reverse path check for locally
targeted traffic.

Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/ipv4/netfilter/nft_fib_ipv4.c
net/ipv6/netfilter/nft_fib_ipv6.c
net/netfilter/nft_fib.c