Signed-off-by: Hannes Frederic Sowa <[email protected]>
---
include/net/net_namespace.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index c59fb018da5e46..9be39b8315a6f9 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -244,6 +244,14 @@ int net_eq(const struct net *net1, const struct net *net2)
#define net_drop_ns NULL
#endif
+static inline struct afnetns *net_afnetns(struct net *net)
+{
+#if IS_ENABLED(CONFIG_AFNETNS)
+ return net->afnet_ns;
+#else
+ return NULL;
+#endif
+}
typedef struct {
#ifdef CONFIG_NET_NS
--
2.9.3