]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
dccp: do not use ipv6 header for ipv4 flow
authorEric Dumazet <edumazet@google.com>
Tue, 19 Mar 2019 12:46:18 +0000 (05:46 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2019 04:22:12 +0000 (06:22 +0200)
[ Upstream commit e0aa67709f89d08c8d8e5bdd9e0b649df61d0090 ]

When a dual stack dccp listener accepts an ipv4 flow,
it should not attempt to use an ipv6 header or
inet6_iif() helper.

Fixes: 3df80d9320bc ("[DCCP]: Introduce DCCPv6")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/dccp/ipv6.c

index 4d925dbe4bb7a368bdddfe6ab10bec3e39810ce3..6dd6a7d4373ce640cfad83e5e262acf32a651b87 100644 (file)
@@ -490,8 +490,8 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
                newnp->ipv6_mc_list = NULL;
                newnp->ipv6_ac_list = NULL;
                newnp->ipv6_fl_list = NULL;
-               newnp->mcast_oif   = inet6_iif(skb);
-               newnp->mcast_hops  = ipv6_hdr(skb)->hop_limit;
+               newnp->mcast_oif   = inet_iif(skb);
+               newnp->mcast_hops  = ip_hdr(skb)->ttl;
 
                /*
                 * No need to charge this sock to the relevant IPv6 refcnt debug socks count