diff options
author | Daniel T. Lee <danieltimlee@gmail.com> | 2023-01-15 16:16:07 +0900 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-01-15 13:32:45 -0800 |
commit | 31b12a4159fae818ac1043539ec9656da57b2e2c (patch) | |
tree | c507ad91ce0075bbc59670056c42c539179bbd60 /Kconfig | |
parent | dac808c90749c7dddd91f01f1f4252d2518d5ea0 (diff) |
samples/bpf: fix broken cgroup socket testing
Currently, executing test_cgrp2_sock2 fails due to wrong section
header. This 'cgroup/sock1' style section is previously used at
'samples/bpf_load' (deprecated) BPF loader. Because this style isn't
supported in libbpf, this commit fixes this problem by correcting the
section header.
$ sudo ./test_cgrp2_sock2.sh
libbpf: prog 'bpf_prog1': missing BPF prog type, check ELF section name 'cgroup/sock1'
libbpf: prog 'bpf_prog1': failed to load: -22
libbpf: failed to load object './sock_flags_kern.o'
ERROR: loading BPF object file failed
In addition, this BPF program filters ping packets by comparing whether
the socket type uses SOCK_RAW. However, after the ICMP socket[1] was
developed, ping sends ICMP packets using SOCK_DGRAM. Therefore, in this
commit, the packet filtering is changed to use SOCK_DGRAM instead of
SOCK_RAW.
$ strace --trace socket ping -6 -c1 -w1 ::1
socket(AF_INET6, SOCK_DGRAM, IPPROTO_ICMPV6) = 3
[1]: https://lwn.net/Articles/422330/
Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
Link: https://lore.kernel.org/r/20230115071613.125791-5-danieltimlee@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'Kconfig')
0 files changed, 0 insertions, 0 deletions