Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[sfrench/cifs-2.6.git] / net / mptcp / protocol.c
index b6dc6e260334f52032a225535afd0afff2532cc2..109eea2c65ff7fb75330f5322714c92595520e7d 100644 (file)
@@ -2730,6 +2730,8 @@ static int mptcp_init_sock(struct sock *sk)
        if (ret)
                return ret;
 
+       set_bit(SOCK_CUSTOM_SOCKOPT, &sk->sk_socket->flags);
+
        /* fetch the ca name; do it outside __mptcp_init_sock(), so that clone will
         * propagate the correct value
         */
@@ -3707,6 +3709,8 @@ static int mptcp_stream_accept(struct socket *sock, struct socket *newsock,
                struct mptcp_subflow_context *subflow;
                struct sock *newsk = newsock->sk;
 
+               set_bit(SOCK_CUSTOM_SOCKOPT, &newsock->flags);
+
                lock_sock(newsk);
 
                /* PM/worker can now acquire the first subflow socket
@@ -3920,12 +3924,6 @@ static const struct proto_ops mptcp_v6_stream_ops = {
 
 static struct proto mptcp_v6_prot;
 
-static void mptcp_v6_destroy(struct sock *sk)
-{
-       mptcp_destroy(sk);
-       inet6_destroy_sock(sk);
-}
-
 static struct inet_protosw mptcp_v6_protosw = {
        .type           = SOCK_STREAM,
        .protocol       = IPPROTO_MPTCP,
@@ -3941,7 +3939,6 @@ int __init mptcp_proto_v6_init(void)
        mptcp_v6_prot = mptcp_prot;
        strcpy(mptcp_v6_prot.name, "MPTCPv6");
        mptcp_v6_prot.slab = NULL;
-       mptcp_v6_prot.destroy = mptcp_v6_destroy;
        mptcp_v6_prot.obj_size = sizeof(struct mptcp6_sock);
 
        err = proto_register(&mptcp_v6_prot, 1);