[Devel] [PATCH rh7] net_namespace.h: move net_access_allowed definition under CONFIG_NET_NS

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Tue Nov 24 09:34:05 PST 2015


It was under NETNS_REFCNT_DEBUG by mistake.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 include/net/net_namespace.h |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 6559905..ea17176 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -208,6 +208,11 @@ int net_eq(const struct net *net1, const struct net *net2)
 
 extern void net_drop_ns(void *);
 
+/* Returns whether curr can mess with net's objects */
+static inline int net_access_allowed(const struct net *net, const struct net *curr)
+{
+	return net_eq(curr, &init_net) || net_eq(curr, net);
+}
 #else
 
 static inline struct net *get_net(struct net *net)
@@ -231,6 +236,11 @@ int net_eq(const struct net *net1, const struct net *net2)
 }
 
 #define net_drop_ns NULL
+
+static inline int net_access_allowed(const struct net *net, const struct net *curr)
+{
+	return 1;
+}
 #endif
 
 
@@ -248,11 +258,6 @@ static inline void release_net(struct net *net)
 		atomic_dec(&net->use_count);
 }
 
-/* Returns whether curr can mess with net's objects */
-static inline int net_access_allowed(const struct net *net, const struct net *curr)
-{
-	return net_eq(curr, &init_net) || net_eq(curr, net);
-}
 #else
 static inline struct net *hold_net(struct net *net)
 {
@@ -262,11 +267,6 @@ static inline struct net *hold_net(struct net *net)
 static inline void release_net(struct net *net)
 {
 }
-
-static inline int net_access_allowed(const struct net *net, const struct net *curr)
-{
-	return 1;
-}
 #endif
 
 #ifdef CONFIG_NET_NS



More information about the Devel mailing list