Commit 89277f98 authored by Hideaki Yoshifuji's avatar Hideaki Yoshifuji

[IPV6] Fix routing header handling.

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: default avatarHideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
parent beb0e5c2
...@@ -314,9 +314,11 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp) ...@@ -314,9 +314,11 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
dst_release(xchg(&skb->dst, NULL)); dst_release(xchg(&skb->dst, NULL));
ip6_route_input(skb); ip6_route_input(skb);
if (skb->dst->error) { if (skb->dst->error) {
skb_push(skb, skb->data - skb->nh.raw);
dst_input(skb); dst_input(skb);
return -1; return -1;
} }
if (skb->dst->dev->flags&IFF_LOOPBACK) { if (skb->dst->dev->flags&IFF_LOOPBACK) {
if (skb->nh.ipv6h->hop_limit <= 1) { if (skb->nh.ipv6h->hop_limit <= 1) {
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS); IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
...@@ -329,6 +331,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp) ...@@ -329,6 +331,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
goto looped_back; goto looped_back;
} }
skb_push(skb, skb->data - skb->nh.raw);
dst_input(skb); dst_input(skb);
return -1; return -1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment