Skip to content

Commit

Permalink
bpf, net: Fix build issue when net ns not configured
Browse files Browse the repository at this point in the history
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 <lkp@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
Daniel Borkmann committed Mar 29, 2020
1 parent ae661de commit 5a95cbb
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions include/net/net_namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,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);
Expand Down Expand Up @@ -276,8 +278,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)
Expand Down Expand Up @@ -305,11 +305,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

Expand Down

0 comments on commit 5a95cbb

Please sign in to comment.