Commit a45b770
bpf_fib_lookup: always return target ifindex
The bpf_fib_lookup() helper performs a neighbour lookup for the destination
IP and returns BPF_FIB_LKUP_NO_NEIGH if this fails, with the expectation
that the BPF program will pass the packet up the stack in this case.
However, with the addition of bpf_redirect_neigh() that can be used instead
to perform the neighbour lookup, at the cost of a bit of duplicated work.
For that we still need the target ifindex, and since bpf_fib_lookup()
already has that at the time it performs the neighbour lookup, there is
really no reason why it can't just return it in any case. So let's just
always return the ifindex if the FIB lookup itself succeeds.
Cc: David Ahern <dsahern@gmail.com>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>1 parent 93db11a commit a45b770
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5234 | 5234 | | |
5235 | 5235 | | |
5236 | 5236 | | |
5237 | | - | |
5238 | 5237 | | |
5239 | 5238 | | |
5240 | 5239 | | |
| |||
5331 | 5330 | | |
5332 | 5331 | | |
5333 | 5332 | | |
| 5333 | + | |
5334 | 5334 | | |
5335 | 5335 | | |
5336 | 5336 | | |
| |||
5456 | 5456 | | |
5457 | 5457 | | |
5458 | 5458 | | |
| 5459 | + | |
5459 | 5460 | | |
5460 | 5461 | | |
5461 | 5462 | | |
| |||
0 commit comments