Allow looking up a sock_common. This gives eBPF programs access to timewait and request sockets.
Showing the changes to include/uapi/linux (1 of 3 files). Show all
Unified · Split
| @@ -2431,6 +2431,23 @@ union bpf_attr { · 2430 unmodified lines | |||
| 2431 | * Return | 2431 | * Return |
| 2432 | * A **struct bpf_sock** pointer on success, or **NULL** in | 2432 | * A **struct bpf_sock** pointer on success, or **NULL** in |
| 2433 | * case of failure. | 2433 | * case of failure. |
| 2434 | * | ||
| 2435 | * struct bpf_sock *bpf_skc_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags) | ||
| 2436 | * Description | ||
| 2437 | * Look for TCP socket matching *tuple*, optionally in a child | ||
| 2438 | * network namespace *netns*. The return value must be checked, | ||
| 2439 | * and if non-**NULL**, released via **bpf_sk_release**\ (). | ||
| 2440 | * | ||
| 2441 | * This function is identical to bpf_sk_lookup_tcp, except that it | ||
| 2442 | * also returns timewait or request sockets. Use bpf_sk_fullsock | ||
| 2443 | * or bpf_tcp_socket to access the full structure. | ||
| 2444 | * | ||
| 2445 | * This helper is available only if the kernel was compiled with | ||
| 2446 | * **CONFIG_NET** configuration option. | ||
| 2447 | * Return | ||
| 2448 | * Pointer to **struct bpf_sock**, or **NULL** in case of failure. | ||
| 2449 | * For sockets with reuseport option, the **struct bpf_sock** | ||
| 2450 | * result is from **reuse->socks**\ [] using the hash of the tuple. | ||
| 2434 | */ | 2451 | */ |
| 2435 | #define __BPF_FUNC_MAPPER(FN) \ | 2452 | #define __BPF_FUNC_MAPPER(FN) \ |
| 2436 | FN(unspec), \ | 2453 | FN(unspec), \ |
| @@ -2531,7 +2548,8 @@ union bpf_attr { · 94 unmodified lines | |||
| 2531 | FN(sk_fullsock), \ | 2548 | FN(sk_fullsock), \ |
| 2532 | FN(tcp_sock), \ | 2549 | FN(tcp_sock), \ |
| 2533 | FN(skb_ecn_set_ce), \ | 2550 | FN(skb_ecn_set_ce), \ |
| 2534 | FN(get_listener_sock), | 2551 | FN(get_listener_sock), \ |
| 2552 | FN(skc_lookup_tcp), | ||
| 2535 | 2553 | ||
| 2536 | /* integer value in 'imm' field of BPF_CALL instruction selects which helper | 2554 | /* integer value in 'imm' field of BPF_CALL instruction selects which helper |
| 2537 | * function eBPF program intends to call | 2555 | * function eBPF program intends to call |