From: YOSHIFUJI Hideaki Date: Fri, 11 Apr 2008 14:51:26 +0000 (+0900) Subject: [IPV6]: Fix IPV6_RECVERR for connected raw sockets. X-Git-Tag: v2.6.26-rc1~1138^2~123^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=05f175cdcf9d3615c1633615d87891ebfb729401;p=linux-2.6-omap-h63xx.git [IPV6]: Fix IPV6_RECVERR for connected raw sockets. Based on patch from Dmitry Butskoy . Closes: 10437 Signed-off-by: YOSHIFUJI Hideaki --- diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 059298baa1d..6193b124cbc 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c @@ -357,8 +357,10 @@ void raw6_icmp_error(struct sk_buff *skb, int nexthdr, read_lock(&raw_v6_hashinfo.lock); sk = sk_head(&raw_v6_hashinfo.ht[hash]); if (sk != NULL) { - saddr = &ipv6_hdr(skb)->saddr; - daddr = &ipv6_hdr(skb)->daddr; + /* Note: ipv6_hdr(skb) != skb->data */ + struct ipv6hdr *ip6h = (struct ipv6hdr *)skb->data; + saddr = &ip6h->saddr; + daddr = &ip6h->daddr; net = dev_net(skb->dev); while ((sk = __raw_v6_lookup(net, sk, nexthdr, saddr, daddr,