History

bpf: export bpf_sock for BPF_PROG_TYPE_CGROUP_SOCK_ADDR prog type

And let it use bpf_sk_storage_{get,delete} helpers to access socket storage. Kernel context (struct bpf_sock_addr_kern) already has sk member, so I just expose it to the BPF hooks. Using PTR_TO_SOCKET instead of PTR_TO_SOCK_COMMON should be safe because the hook is called on bind/connect.

Stanislav Fomichev committed 7 years ago

Commit fb85c4a1 parent d30bd782 files · +17 −0Browse files

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

Unified · Split

include/uapi/linux/bpf.h+1−0
@@ -3247,6 +3247,7 @@ struct bpf_sock_addr { · 3246 unmodified lines
3247 __u32 msg_src_ip6[4]; /* Allows 1,2,4-byte read an 4-byte write.3247 __u32 msg_src_ip6[4]; /* Allows 1,2,4-byte read an 4-byte write.
3248 * Stored in network byte order.3248 * Stored in network byte order.
3249 */3249 */
3250 __bpf_md_ptr(struct bpf_sock *, sk);
3250};3251};
3251 3252
3252/* User bpf_sock_ops struct to access socket values and specify request ops3253/* User bpf_sock_ops struct to access socket values and specify request ops

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t