summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/bpf.h
diff options
context:
space:
mode:
authorDavid Ahern2016-12-01 17:48:06 +0100
committerDavid S. Miller2016-12-02 19:46:09 +0100
commitaa4c1037a30f4e88f444e83d42c2befbe0d5caf5 (patch)
treee2bb34c401d93df49f035a1d45c01fdff44b371d /include/uapi/linux/bpf.h
parentsamples: bpf: add userspace example for modifying sk_bound_dev_if (diff)
downloadkernel-qcow2-linux-aa4c1037a30f4e88f444e83d42c2befbe0d5caf5.tar.gz
kernel-qcow2-linux-aa4c1037a30f4e88f444e83d42c2befbe0d5caf5.tar.xz
kernel-qcow2-linux-aa4c1037a30f4e88f444e83d42c2befbe0d5caf5.zip
bpf: Add support for reading socket family, type, protocol
Add socket family, type and protocol to bpf_sock allowing bpf programs read-only access. Add __sk_flags_offset[0] to struct sock before the bitfield to programmtically determine the offset of the unsigned int containing protocol and type. Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/bpf.h')
-rw-r--r--include/uapi/linux/bpf.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index bfe5e31a1288..6123d9b8e828 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -571,6 +571,9 @@ enum bpf_ret_code {
struct bpf_sock {
__u32 bound_dev_if;
+ __u32 family;
+ __u32 type;
+ __u32 protocol;
};
/* User return codes for XDP prog type.