l2tp: take PMTU from tunnel UDP socket
authorDmitry Petukhov <dmgenp@gmail.com>
Tue, 8 Apr 2014 20:23:20 +0000 (02:23 +0600)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Apr 2014 19:24:38 +0000 (15:24 -0400)
When l2tp driver tries to get PMTU for the tunnel destination, it uses
the pointer to struct sock that represents PPPoX socket, while it
should use the pointer that represents UDP socket of the tunnel.

Signed-off-by: Dmitry Petukhov <dmgenp@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_ppp.c

index d276e2d4a5894c38c6489eb2f814542a181f6d75..950909f04ee6ab598a0bdd16f8d6ad6ec2a931ed 100644 (file)
@@ -753,9 +753,9 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
        session->deref = pppol2tp_session_sock_put;
 
        /* If PMTU discovery was enabled, use the MTU that was discovered */
-       dst = sk_dst_get(sk);
+       dst = sk_dst_get(tunnel->sock);
        if (dst != NULL) {
-               u32 pmtu = dst_mtu(__sk_dst_get(sk));
+               u32 pmtu = dst_mtu(__sk_dst_get(tunnel->sock));
                if (pmtu != 0)
                        session->mtu = session->mru = pmtu -
                                PPPOL2TP_HEADER_OVERHEAD;