diff mbox series

[04/13] bpf, net: Fix build issue when net ns not configured

Message ID 20200831040333.6058-5-khalid.elmously@canonical.com
State New
Headers show
Series Requested eBPF improvements | expand

Commit Message

Khalid Elmously Aug. 31, 2020, 4:03 a.m. UTC
From: Daniel Borkmann <daniel@iogearbox.net>

BugLink: https://bugs.launchpad.net/bugs/1887740

[ upstream commit 5a95cbb80ef8d8f2db29ab10777cd4742e6fc8ec ]

Fix a redefinition of 'net_gen_cookie' error that was overlooked
when net ns is not configured.

Fixes: f318903c0bf4 ("bpf: Add netns cookie and enable it for bpf cgroup hooks")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
---
 include/net/net_namespace.h | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 2502ffcf0ddf..aa42db4aa410 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -225,6 +225,8 @@  extern struct list_head net_namespace_list;
 struct net *get_net_ns_by_pid(pid_t pid);
 struct net *get_net_ns_by_fd(int fd);
 
+u64 net_gen_cookie(struct net *net);
+
 #ifdef CONFIG_SYSCTL
 void ipx_register_sysctl(void);
 void ipx_unregister_sysctl(void);
@@ -273,8 +275,6 @@  static inline int check_net(const struct net *net)
 
 void net_drop_ns(void *);
 
-u64 net_gen_cookie(struct net *net);
-
 #else
 
 static inline struct net *get_net(struct net *net)
@@ -302,11 +302,6 @@  static inline int check_net(const struct net *net)
 	return 1;
 }
 
-static inline u64 net_gen_cookie(struct net *net)
-{
-	return 0;
-}
-
 #define net_drop_ns NULL
 #endif