@@ -146,4 +146,14 @@ static inline bool mptcp_sk_is_subflow(const struct sock *sk)
}
#endif /* CONFIG_MPTCP */
+
+#if IS_ENABLED(CONFIG_MPTCP_IPV6)
+int mptcpv6_init(void);
+#elif IS_ENABLED(CONFIG_IPV6)
+static inline int mptcpv6_init(void)
+{
+ return 0;
+}
+#endif
+
#endif /* __NET_MPTCP_H */
@@ -2108,9 +2108,16 @@ int __init tcpv6_init(void)
ret = register_pernet_subsys(&tcpv6_net_ops);
if (ret)
goto out_tcpv6_protosw;
+
+ ret = mptcpv6_init();
+ if (ret)
+ goto out_tcpv6_pernet_subsys;
+
out:
return ret;
+out_tcpv6_pernet_subsys:
+ unregister_pernet_subsys(&tcpv6_net_ops);
out_tcpv6_protosw:
inet6_unregister_protosw(&tcpv6_protosw);
out_tcpv6_protocol:
@@ -963,3 +963,22 @@ void mptcp_proto_init(void)
inet_register_protosw(&mptcp_protosw);
}
+
+#if IS_ENABLED(CONFIG_MPTCP_IPV6)
+static struct inet_protosw mptcp_v6_protosw = {
+ .type = SOCK_STREAM,
+ .protocol = IPPROTO_MPTCP,
+ .prot = &mptcp_prot,
+ .ops = &inet6_stream_ops,
+ .flags = INET_PROTOSW_ICSK,
+};
+
+int mptcpv6_init(void)
+{
+ int err;
+
+ err = inet6_register_protosw(&mptcp_v6_protosw);
+
+ return err;
+}
+#endif
squashto: Add MPTCP socket stubs Signed-off-by: Peter Krystad <peter.krystad@linux.intel.com> --- include/net/mptcp.h | 10 ++++++++++ net/ipv6/tcp_ipv6.c | 7 +++++++ net/mptcp/protocol.c | 19 +++++++++++++++++++ 3 files changed, 36 insertions(+)