mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-22 17:29:07 +08:00
selftests/bpf: Cover 4-byte load from remote_port in bpf_sk_lookup
Extend the context access tests for sk_lookup prog to cover the surprising case of a 4-byte load from the remote_port field, where the expected value is actually shifted by 16 bits. Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20220209184333.654927-3-jakub@cloudflare.com
This commit is contained in:
committed by
Andrii Nakryiko
parent
67f813c8a8
commit
7593fc7a85
@@ -6453,7 +6453,8 @@ struct bpf_sk_lookup {
|
||||
__u32 protocol; /* IP protocol (IPPROTO_TCP, IPPROTO_UDP) */
|
||||
__u32 remote_ip4; /* Network byte order */
|
||||
__u32 remote_ip6[4]; /* Network byte order */
|
||||
__u32 remote_port; /* Network byte order */
|
||||
__be16 remote_port; /* Network byte order */
|
||||
__u16 :16; /* Zero padding */
|
||||
__u32 local_ip4; /* Network byte order */
|
||||
__u32 local_ip6[4]; /* Network byte order */
|
||||
__u32 local_port; /* Host byte order */
|
||||
|
||||
Reference in New Issue
Block a user