[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170312230151.5185-10-hannes@stressinduktion.org>
Date: Mon, 13 Mar 2017 00:01:33 +0100
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
To: netdev@...r.kernel.org
Subject: [PATCH net-next RFC v1 09/27] afnetns: add sock_afnetns
Signed-off-by: Hannes Frederic Sowa <hannes@...essinduktion.org>
---
include/net/sock.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/net/sock.h b/include/net/sock.h
index 1e05d497db2520..aa204bf3537ba0 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2293,6 +2293,15 @@ struct net *sock_net(const struct sock *sk)
return read_pnet(&sk->sk_net);
}
+static inline struct afnetns *sock_afnetns(const struct sock *sk)
+{
+#if IS_ENABLED(CONFIG_AFNETNS)
+ return sk->sk_afnet;
+#else
+ return NULL;
+#endif
+}
+
static inline
void sock_net_set(struct sock *sk, struct net *net)
{
--
2.9.3
Powered by blists - more mailing lists