summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMark Pashmfouroush <markpash@cloudflare.com>2021-11-10 14:10:15 +0300
committerAlexei Starovoitov <ast@kernel.org>2021-11-11 03:29:58 +0300
commitf89315650ba34ec6c91a8bded72796980bee2a4d (patch)
treec860a28dda8d188d6cdc7c863942d5dd7d77b83e /tools
parent1a8b597ddabe7dc25aa9defd33949d455ee9cde8 (diff)
downloadlinux-f89315650ba34ec6c91a8bded72796980bee2a4d.tar.xz
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
Diffstat (limited to 'tools')
-rw-r--r--tools/include/uapi/linux/bpf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 509eee5f0393..6297eafdc40f 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -6316,6 +6316,7 @@ struct bpf_sk_lookup {
__u32 local_ip4; /* Network byte order */
__u32 local_ip6[4]; /* Network byte order */
__u32 local_port; /* Host byte order */
+ __u32 ingress_ifindex; /* The arriving interface. Determined by inet_iif. */
};
/*