Skip to content

Commit 5a95cbb

Browse files
committed
bpf, net: Fix build issue when net ns not configured
Fix a redefinition of 'net_gen_cookie' error that was overlooked when net ns is not configured. Fixes: f318903 ("bpf: Add netns cookie and enable it for bpf cgroup hooks") Reported-by: kbuild test robot <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
1 parent ae661de commit 5a95cbb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

include/net/net_namespace.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ extern struct list_head net_namespace_list;
228228
struct net *get_net_ns_by_pid(pid_t pid);
229229
struct net *get_net_ns_by_fd(int fd);
230230

231+
u64 net_gen_cookie(struct net *net);
232+
231233
#ifdef CONFIG_SYSCTL
232234
void ipx_register_sysctl(void);
233235
void ipx_unregister_sysctl(void);
@@ -276,8 +278,6 @@ static inline int check_net(const struct net *net)
276278

277279
void net_drop_ns(void *);
278280

279-
u64 net_gen_cookie(struct net *net);
280-
281281
#else
282282

283283
static inline struct net *get_net(struct net *net)
@@ -305,11 +305,6 @@ static inline int check_net(const struct net *net)
305305
return 1;
306306
}
307307

308-
static inline u64 net_gen_cookie(struct net *net)
309-
{
310-
return 0;
311-
}
312-
313308
#define net_drop_ns NULL
314309
#endif
315310

0 commit comments

Comments
 (0)