net_namespace.h (f63e4f7d4179c9157c51bbe82af7c8f6b5fb39dd) net_namespace.h (7866cc57b51c1e118e5d78d1a8f721f378eec5c4)
1/*
2 * Operations on the network namespace
3 */
4#ifndef __NET_NET_NAMESPACE_H
5#define __NET_NET_NAMESPACE_H
6
7#include <linux/atomic.h>
8#include <linux/workqueue.h>

--- 144 unchanged lines hidden (view full) ---

153
154/* Init's network namespace */
155extern struct net init_net;
156
157#ifdef CONFIG_NET_NS
158struct net *copy_net_ns(unsigned long flags, struct user_namespace *user_ns,
159 struct net *old_net);
160
1/*
2 * Operations on the network namespace
3 */
4#ifndef __NET_NET_NAMESPACE_H
5#define __NET_NET_NAMESPACE_H
6
7#include <linux/atomic.h>
8#include <linux/workqueue.h>

--- 144 unchanged lines hidden (view full) ---

153
154/* Init's network namespace */
155extern struct net init_net;
156
157#ifdef CONFIG_NET_NS
158struct net *copy_net_ns(unsigned long flags, struct user_namespace *user_ns,
159 struct net *old_net);
160
161void net_ns_barrier(void);
161#else /* CONFIG_NET_NS */
162#include <linux/sched.h>
163#include <linux/nsproxy.h>
164static inline struct net *copy_net_ns(unsigned long flags,
165 struct user_namespace *user_ns, struct net *old_net)
166{
167 if (flags & CLONE_NEWNET)
168 return ERR_PTR(-EINVAL);
169 return old_net;
170}
162#else /* CONFIG_NET_NS */
163#include <linux/sched.h>
164#include <linux/nsproxy.h>
165static inline struct net *copy_net_ns(unsigned long flags,
166 struct user_namespace *user_ns, struct net *old_net)
167{
168 if (flags & CLONE_NEWNET)
169 return ERR_PTR(-EINVAL);
170 return old_net;
171}
172
173static inline void net_ns_barrier(void) {}
171#endif /* CONFIG_NET_NS */
172
173
174extern struct list_head net_namespace_list;
175
176struct net *get_net_ns_by_pid(pid_t pid);
177struct net *get_net_ns_by_fd(int fd);
178

--- 210 unchanged lines hidden ---
174#endif /* CONFIG_NET_NS */
175
176
177extern struct list_head net_namespace_list;
178
179struct net *get_net_ns_by_pid(pid_t pid);
180struct net *get_net_ns_by_fd(int fd);
181

--- 210 unchanged lines hidden ---