return ret;
}
-static struct proto_ops mptcp_stream_ops;
+static const struct proto_ops mptcp_stream_ops = {
+ .family = PF_INET,
+ .owner = THIS_MODULE,
+ .release = inet_release,
+ .bind = mptcp_bind,
+ .connect = mptcp_stream_connect,
+ .socketpair = sock_no_socketpair,
+ .accept = mptcp_stream_accept,
+ .getname = mptcp_v4_getname,
+ .poll = mptcp_poll,
+ .ioctl = inet_ioctl,
+ .gettstamp = sock_gettstamp,
+ .listen = mptcp_listen,
+ .shutdown = mptcp_shutdown,
+ .setsockopt = sock_common_setsockopt,
+ .getsockopt = sock_common_getsockopt,
+ .sendmsg = inet_sendmsg,
+ .recvmsg = inet_recvmsg,
+ .mmap = sock_no_mmap,
+ .sendpage = inet_sendpage,
+#ifdef CONFIG_COMPAT
+ .compat_setsockopt = compat_sock_common_setsockopt,
+ .compat_getsockopt = compat_sock_common_getsockopt,
+#endif
+};
static struct inet_protosw mptcp_protosw = {
.type = SOCK_STREAM,
void mptcp_proto_init(void)
{
mptcp_prot.h.hashinfo = tcp_prot.h.hashinfo;
- mptcp_stream_ops = inet_stream_ops;
- mptcp_stream_ops.bind = mptcp_bind;
- mptcp_stream_ops.connect = mptcp_stream_connect;
- mptcp_stream_ops.poll = mptcp_poll;
- mptcp_stream_ops.accept = mptcp_stream_accept;
- mptcp_stream_ops.getname = mptcp_v4_getname;
- mptcp_stream_ops.listen = mptcp_listen;
- mptcp_stream_ops.shutdown = mptcp_shutdown;
mptcp_subflow_init();
}
#if IS_ENABLED(CONFIG_MPTCP_IPV6)
-static struct proto_ops mptcp_v6_stream_ops;
+static const struct proto_ops mptcp_v6_stream_ops = {
+ .family = PF_INET6,
+ .owner = THIS_MODULE,
+ .release = inet6_release,
+ .bind = mptcp_bind,
+ .connect = mptcp_stream_connect,
+ .socketpair = sock_no_socketpair,
+ .accept = mptcp_stream_accept,
+ .getname = mptcp_v6_getname,
+ .poll = mptcp_poll,
+ .ioctl = inet6_ioctl,
+ .gettstamp = sock_gettstamp,
+ .listen = mptcp_listen,
+ .shutdown = mptcp_shutdown,
+ .setsockopt = sock_common_setsockopt,
+ .getsockopt = sock_common_getsockopt,
+ .sendmsg = inet6_sendmsg,
+ .recvmsg = inet6_recvmsg,
+ .mmap = sock_no_mmap,
+ .sendpage = inet_sendpage,
+#ifdef CONFIG_COMPAT
+ .compat_setsockopt = compat_sock_common_setsockopt,
+ .compat_getsockopt = compat_sock_common_getsockopt,
+#endif
+};
+
static struct proto mptcp_v6_prot;
static void mptcp_v6_destroy(struct sock *sk)
if (err)
return err;
- mptcp_v6_stream_ops = inet6_stream_ops;
- mptcp_v6_stream_ops.bind = mptcp_bind;
- mptcp_v6_stream_ops.connect = mptcp_stream_connect;
- mptcp_v6_stream_ops.poll = mptcp_poll;
- mptcp_v6_stream_ops.accept = mptcp_stream_accept;
- mptcp_v6_stream_ops.getname = mptcp_v6_getname;
- mptcp_v6_stream_ops.listen = mptcp_listen;
- mptcp_v6_stream_ops.shutdown = mptcp_shutdown;
-
err = inet6_register_protosw(&mptcp_v6_protosw);
if (err)
proto_unregister(&mptcp_v6_prot);