History

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.

David Ahern committed 9 years ago

Commit aa4c1031 parent ad2805d3 files · +39 −0Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/bpf.h+3−0
@@ -571,6 +571,9 @@ enum bpf_ret_code { · 570 unmodified lines
571571
572572 struct bpf_sock {
573573 __u32 bound_dev_if;
574+ __u32 family;
575+ __u32 type;
576+ __u32 protocol;
574577 };
575578
576579 /* User return codes for XDP prog type.