Re: [PATCH bpf-next v2] selftests/bpf: Fix error: undeclared identifier 'NF_NAT_MANIP_SRC'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rong Tao <rtoax@xxxxxxxxxxx> writes:

> From: Rong Tao <rongtao@xxxxxxxx>
>
> commit 472caa69183f("netfilter: nat: un-export nf_nat_used_tuple")
> introduce NF_NAT_MANIP_SRC/DST enum in include/net/netfilter/nf_nat.h,
> and commit b06b45e82b59("selftests/bpf: add tests for bpf_ct_set_nat_info
> kfunc") use NF_NAT_MANIP_SRC/DST in test_bpf_nf.c.
>
> In bpf kself-test config (tools/testing/selftests/bpf/config) nf_nat
> is compiled as built-in, this issue occurs just if it is compiled as
> module. we just hardcode 1/0 here.
>
> How to reproduce the error:
>
>    $ make -C tools/testing/selftests/bpf/
>    ...
>       CLNG-BPF [test_maps] test_bpf_nf.bpf.o
>       error: use of undeclared identifier 'NF_NAT_MANIP_SRC'
>             bpf_ct_set_nat_info(ct, &saddr, sport, NF_NAT_MANIP_SRC);
>                                                          ^
>       error: use of undeclared identifier 'NF_NAT_MANIP_DST'
>             bpf_ct_set_nat_info(ct, &daddr, dport, NF_NAT_MANIP_DST);
>                                                          ^
>    2 errors generated.
>
> Signed-off-by: Rong Tao <rongtao@xxxxxxxx>

This will fix the compilation, but the selftest won't actually work when
nf_nat is compiled as a module (see [0]). Would be better to fix the
test properly instead of just papering over the compilation issue like
this. That requires a bit more surgery to the selftests, though...

-Toke

[0] https://lore.kernel.org/r/87leoh372s.fsf@xxxxxxx



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux