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.
Showing the changes to include/uapi/linux (1 of 3 files). Show all
Unified · Split
| @@ -571,6 +571,9 @@ enum bpf_ret_code { · 570 unmodified lines | |||
| 571 | 571 | ||
| 572 | struct bpf_sock { | 572 | struct bpf_sock { |
| 573 | __u32 bound_dev_if; | 573 | __u32 bound_dev_if; |
| 574 | __u32 family; | ||
| 575 | __u32 type; | ||
| 576 | __u32 protocol; | ||
| 574 | }; | 577 | }; |
| 575 | 578 | ||
| 576 | /* User return codes for XDP prog type. | 579 | /* User return codes for XDP prog type. |