summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/bpf.h
diff options
context:
space:
mode:
authorJohn Fastabend2018-05-17 23:16:58 +0200
committerDaniel Borkmann2018-05-18 22:44:10 +0200
commit303def35f64e37bcd5401d202889f5fbc0241179 (patch)
tree2ec1213038df81591e3b99242116a3ae5239e4fe /include/uapi/linux/bpf.h
parentMerge branch 'bpf-nfp-shift-insns' (diff)
downloadkernel-qcow2-linux-303def35f64e37bcd5401d202889f5fbc0241179.tar.gz
kernel-qcow2-linux-303def35f64e37bcd5401d202889f5fbc0241179.tar.xz
kernel-qcow2-linux-303def35f64e37bcd5401d202889f5fbc0241179.zip
bpf: allow sk_msg programs to read sock fields
Currently sk_msg programs only have access to the raw data. However, it is often useful when building policies to have the policies specific to the socket endpoint. This allows using the socket tuple as input into filters, etc. This patch adds ctx access to the sock fields. Signed-off-by: John Fastabend <john.fastabend@gmail.com> Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/uapi/linux/bpf.h')
-rw-r--r--include/uapi/linux/bpf.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index d94d333a8225..97446bbe2ca5 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -2176,6 +2176,14 @@ enum sk_action {
struct sk_msg_md {
void *data;
void *data_end;
+
+ __u32 family;
+ __u32 remote_ip4; /* Stored in network byte order */
+ __u32 local_ip4; /* Stored in network byte order */
+ __u32 remote_ip6[4]; /* Stored in network byte order */
+ __u32 local_ip6[4]; /* Stored in network byte order */
+ __u32 remote_port; /* Stored in network byte order */
+ __u32 local_port; /* stored in host byte order */
};
#define BPF_TAG_SIZE 8