On Fri, Jul 8, 2022 at 9:49 AM Song Liu song@kernel.org wrote:
On Fri, Jul 8, 2022 at 6:03 AM Maxim Mikityanskiy maximmi@nvidia.com wrote:
When CONFIG_NF_CONNTRACK=m, struct bpf_ct_opts and enum member BPF_F_CURRENT_NETNS are not exposed. This commit allows building the xdp_synproxy selftest in such cases. Note that nf_conntrack must be loaded before running the test if it's compiled as a module.
This commit also allows this selftest to be successfully compiled when CONFIG_NF_CONNTRACK is disabled.
One unused local variable of type struct bpf_ct_opts is also removed.
Reported-by: Yauheni Kaliuta ykaliuta@redhat.com Signed-off-by: Maxim Mikityanskiy maximmi@nvidia.com Fixes: fb5cd0ce70d4 ("selftests/bpf: Add selftests for raw syncookie helpers")
Given tools/testing/selftests/bpf/config specifies CONFIG_NF_CONNTRACK=y, I don't think this is really necessary.
We do redefine some of the kernel structs (e.g., bpf_iter.h), though, to simplify build systems if it doesn't cost much maintenance burden. Which seems to be the case here. So I've applied this to bpf-next tree.
Thanks, Song
[...]