]> git.hungrycats.org Git - linux/commitdiff
[IPV6] Fix routing header handling.
authorHideaki Yoshifuji <yoshfuji@linux-ipv6.org>
Tue, 28 Sep 2004 20:25:48 +0000 (05:25 +0900)
committerHideaki Yoshifuji <yoshfuji@linux-ipv6.org>
Tue, 28 Sep 2004 20:25:48 +0000 (05:25 +0900)
We need to rewind skb pointers when we forward a packet to other host
because dst_input() assumes that skb->data points head of ipv6 protocol header.

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

index 464a3f4d63e3d34fd241f2dc9e7a9d3e4317f036..2b78c840c3491fbca87015f2f1d806eddf93d733 100644 (file)
@@ -314,9 +314,11 @@ looped_back:
        dst_release(xchg(&skb->dst, NULL));
        ip6_route_input(skb);
        if (skb->dst->error) {
+               skb_push(skb, skb->data - skb->nh.raw);
                dst_input(skb);
                return -1;
        }
+
        if (skb->dst->dev->flags&IFF_LOOPBACK) {
                if (skb->nh.ipv6h->hop_limit <= 1) {
                        IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
@@ -329,6 +331,7 @@ looped_back:
                goto looped_back;
        }
 
+       skb_push(skb, skb->data - skb->nh.raw);
        dst_input(skb);
        return -1;
 }