Signed-off-by: Hannes Frederic Sowa <[email protected]>
---
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