Skip to content
Snippets Groups Projects
  1. Dec 14, 2022
  2. Dec 12, 2022
  3. Dec 05, 2022
  4. Dec 04, 2022
  5. Dec 01, 2022
  6. Nov 24, 2022
  7. Nov 23, 2022
  8. Nov 22, 2022
  9. Nov 18, 2022
  10. Nov 10, 2022
  11. Nov 08, 2022
    • Rong Tao's avatar
      samples/bpf: Fix sockex3 error: Missing BPF prog type · e5659e4e
      Rong Tao authored
      
      since commit 450b167f("libbpf: clean up SEC() handling"),
      sec_def_matches() does not recognize "socket/xxx" as "socket", therefore,
      the BPF program type is not recognized.
      
      Instead of sockex3_user.c parsing section names to get the BPF program fd.
      We use the program array map to assign a static index to each BPF program
      (get inspired by selftests/bpf progs/test_prog_array_init.c).
      Therefore, use SEC("socket") as section name instead of SEC("socket/xxx"),
      so that the BPF program is parsed to SOCKET_FILTER type. The "missing BPF
      prog type" problem is solved.
      
      How to reproduce this error:
      $ cd samples/bpf
      $ sudo ./sockex3
      libbpf: prog 'bpf_func_PARSE_IP': missing BPF prog type, check ELF section name 'socket/3'
      libbpf: prog 'bpf_func_PARSE_IP': failed to load: -22
      libbpf: failed to load object './sockex3_kern.o'
      ERROR: loading BPF object file failed
      
      Signed-off-by: default avatarRong Tao <rongtao@cestc.cn>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/tencent_EBA3C18864069E42175946973C2ACBAF5408@qq.com
      e5659e4e
  12. Nov 07, 2022
  13. Nov 04, 2022
  14. Nov 01, 2022
  15. Oct 19, 2022
  16. Oct 17, 2022
  17. Oct 04, 2022
  18. Sep 30, 2022
  19. Sep 29, 2022
  20. Sep 28, 2022
  21. Sep 21, 2022
  22. Sep 05, 2022
  23. Aug 29, 2022
  24. Jul 24, 2022
Loading