From: Eric Dumazet Date: Tue, 19 Mar 2019 12:46:18 +0000 (-0700) Subject: dccp: do not use ipv6 header for ipv4 flow X-Git-Tag: v4.9.167~51 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc8390f9de1455cb96287c6c3cc4e133f103c58c;p=platform%2Fkernel%2Flinux-amlogic.git dccp: do not use ipv6 header for ipv4 flow [ 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 93c706172f40..87c513b5ff2e 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c @@ -431,8 +431,8 @@ static struct sock *dccp_v6_request_recv_sock(const 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