]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Add ingress_ifindex to bpf_sk_lookup
authorMark Pashmfouroush <markpash@cloudflare.com>
Wed, 10 Nov 2021 11:10:15 +0000 (11:10 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 11 Nov 2021 00:29:58 +0000 (16:29 -0800)
commit656c8f22601175cdd729217ef18dd9205a8056b4
treec860a28dda8d188d6cdc7c863942d5dd7d77b83e
parent76e9a924d7d0e27b818afb7eb45bd368cadd52a2
bpf: Add ingress_ifindex to bpf_sk_lookup

It may be helpful to have access to the ifindex during bpf socket
lookup. An example may be to scope certain socket lookup logic to
specific interfaces, i.e. an interface may be made exempt from custom
lookup code.

Add the ifindex of the arriving connection to the bpf_sk_lookup API.

Signed-off-by: Mark Pashmfouroush <markpash@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211110111016.5670-2-markpash@cloudflare.com
include/linux/filter.h
include/uapi/linux/bpf.h
net/core/filter.c
net/ipv4/inet_hashtables.c
net/ipv4/udp.c
net/ipv6/inet6_hashtables.c
net/ipv6/udp.c
tools/include/uapi/linux/bpf.h