Repository navigation
Commit 1314ef5
bpf: export bpf_sock for BPF_PROG_TYPE_SOCK_OPS prog type
And let it use bpf_sk_storage_{get,delete} helpers to access socket
storage. Kernel context (struct bpf_sock_ops_kern) already has sk
member, so I just expose it to the BPF hooks. I use
PTR_TO_SOCKET_OR_NULL and return NULL in !is_fullsock case.
I also export bpf_tcp_sock to make it possible to access tcp socket stats.
Cc: Martin Lau <kafai@fb.com>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>1 parent fb85c4a commit 1314ef5
2 files changed
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3299 | 3299 | | |
3300 | 3300 | | |
3301 | 3301 | | |
| 3302 | + | |
3302 | 3303 | | |
3303 | 3304 | | |
3304 | 3305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6147 | 6147 | | |
6148 | 6148 | | |
6149 | 6149 | | |
| 6150 | + | |
| 6151 | + | |
| 6152 | + | |
| 6153 | + | |
| 6154 | + | |
| 6155 | + | |
| 6156 | + | |
| 6157 | + | |
6150 | 6158 | | |
6151 | 6159 | | |
6152 | 6160 | | |
| |||
6882 | 6890 | | |
6883 | 6891 | | |
6884 | 6892 | | |
| 6893 | + | |
| 6894 | + | |
| 6895 | + | |
| 6896 | + | |
| 6897 | + | |
6885 | 6898 | | |
6886 | 6899 | | |
6887 | 6900 | | |
| |||
8053 | 8066 | | |
8054 | 8067 | | |
8055 | 8068 | | |
| 8069 | + | |
| 8070 | + | |
| 8071 | + | |
| 8072 | + | |
| 8073 | + | |
| 8074 | + | |
| 8075 | + | |
| 8076 | + | |
| 8077 | + | |
| 8078 | + | |
| 8079 | + | |
| 8080 | + | |
| 8081 | + | |
8056 | 8082 | | |
8057 | 8083 | | |
8058 | 8084 | | |
| |||
0 commit comments