All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] selftests/bpf: Fix error undeclared identifier 'NF_NAT_MANIP_SRC'
@ 2022-11-11  3:26 Rong Tao
  2022-11-11 17:25 ` sdf
  0 siblings, 1 reply; 8+ messages in thread
From: Rong Tao @ 2022-11-11  3:26 UTC (permalink / raw)
  To: ast
  Cc: Rong Tao, kernel test robot, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Mykola Lysenko,
	Shuah Khan, Kumar Kartikeya Dwivedi, Lorenzo Bianconi, Daniel Xu,
	open list:BPF [GENERAL] (Safe Dynamic Programs and Tools),
	open list:KERNEL SELFTEST FRAMEWORK, open list

From: Rong Tao <rongtao@cestc.cn>

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. We copy enum
nf_nat_manip_type to test_bpf_nf.c fix this error.

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.

Link: https://lore.kernel.org/lkml/202210280447.STsT1gvq-lkp@intel.com/
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Rong Tao <rongtao@cestc.cn>
---
 tools/testing/selftests/bpf/progs/test_bpf_nf.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/testing/selftests/bpf/progs/test_bpf_nf.c b/tools/testing/selftests/bpf/progs/test_bpf_nf.c
index 227e85e85dda..307ca166ff34 100644
--- a/tools/testing/selftests/bpf/progs/test_bpf_nf.c
+++ b/tools/testing/selftests/bpf/progs/test_bpf_nf.c
@@ -3,6 +3,11 @@
 #include <bpf/bpf_helpers.h>
 #include <bpf/bpf_endian.h>
 
+enum nf_nat_manip_type {
+	NF_NAT_MANIP_SRC,
+	NF_NAT_MANIP_DST
+};
+
 #define EAFNOSUPPORT 97
 #define EPROTO 71
 #define ENONET 64
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-17 14:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-11  3:26 [PATCH bpf-next] selftests/bpf: Fix error undeclared identifier 'NF_NAT_MANIP_SRC' Rong Tao
2022-11-11 17:25 ` sdf
2022-11-11 17:54   ` Lorenzo Bianconi
2022-11-11 18:08     ` Stanislav Fomichev
2022-11-11 18:12       ` Lorenzo Bianconi
2022-11-11 18:55         ` Stanislav Fomichev
2022-11-11 20:44           ` Andrii Nakryiko
2022-11-17 14:15             ` Rong Tao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.