Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
selftests/bpf: Add bpf_program__attach_netfilter helper test
Call bpf_program__attach_netfilter() with different protocol/hook/priority combinations. Test fails if supposedly-illegal attachments work (e.g., bogus protocol family, illegal priority and so on) or if a should-work attachment fails. Expected output: ./test_progs -t netfilter_link_attach torvalds#145/1 netfilter_link_attach/allzero:OK torvalds#145/2 netfilter_link_attach/invalid-pf:OK torvalds#145/3 netfilter_link_attach/invalid-hooknum:OK torvalds#145/4 netfilter_link_attach/invalid-priority-min:OK torvalds#145/5 netfilter_link_attach/invalid-priority-max:OK torvalds#145/6 netfilter_link_attach/invalid-flags:OK torvalds#145/7 netfilter_link_attach/invalid-inet-not-supported:OK torvalds#145/8 netfilter_link_attach/attach ipv4:OK torvalds#145/9 netfilter_link_attach/attach ipv6:OK Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Reviewed-by: Toke Høiland-Jørgensen <[email protected]> Acked-by: Daniel Xu <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
- Loading branch information