This needs a new helper that: - can work in a sleepable context (using sock_gen_cookie) - takes a struct sock pointer and checks that it's not NULL
Showing the changes to include/uapi (1 of 5 files). Show all
Unified · Split
| @@ -1673,6 +1673,14 @@ union bpf_attr { · 1672 unmodified lines | |||
| 1673 | * Return | 1673 | * Return |
| 1674 | * A 8-byte long unique number. | 1674 | * A 8-byte long unique number. |
| 1675 | * | 1675 | * |
| 1676 | * u64 bpf_get_socket_cookie(struct sock *sk) | ||
| 1677 | * Description | ||
| 1678 | * Equivalent to **bpf_get_socket_cookie**\ () helper that accepts | ||
| 1679 | * *sk*, but gets socket from a BTF **struct sock**. This helper | ||
| 1680 | * also works for sleepable programs. | ||
| 1681 | * Return | ||
| 1682 | * A 8-byte long unique number or 0 if *sk* is NULL. | ||
| 1683 | * | ||
| 1676 | * u32 bpf_get_socket_uid(struct sk_buff *skb) | 1684 | * u32 bpf_get_socket_uid(struct sk_buff *skb) |
| 1677 | * Return | 1685 | * Return |
| 1678 | * The owner UID of the socket associated to *skb*. If the socket | 1686 | * The owner UID of the socket associated to *skb*. If the socket |