]> err.no Git - linux-2.6/commitdiff
[IPV6]: Fix IPV6_RECVERR for connected raw sockets.
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Fri, 11 Apr 2008 14:51:26 +0000 (23:51 +0900)
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Sat, 12 Apr 2008 04:43:28 +0000 (13:43 +0900)
Based on patch from Dmitry Butskoy <buc@odusz.so-cdu.ru>.

Closes: 10437
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
net/ipv6/raw.c

index 059298baa1dd696ad491b1d01deeda3759ba0e88..6193b124cbc764bd367df15addead75c07ae0322 100644 (file)
@@ -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,