Subject: [PATCH] [XFRM/IPV6] fix next header offset in decode_session

From: Jean-Philippe Andriot <[email-masked]>
Date: Tue, 7 Nov 2006 10:30:02 +0100

The way to get the next protocol number of an IPv6 tunnel changes
after introducing IP6CB, but I think we should go back to the
previous version here.
In our case I think there was a confusion between the pointer
on the first byte of the next header and the value of the next
header field.

Signed-off-by: Andriot Jean-Philippe <[email-masked]>

--- xfrm6_policy.c.org  2006-11-07 09:45:47.000000000 +0100
+++ xfrm6_policy.c      2006-11-07 09:46:19.000000000 +0100
@@ -255,7 +255,7 @@ _decode_session6(struct sk_buff *skb, st
        u16 offset = skb->h.raw - skb->nh.raw;
        struct ipv6hdr *hdr = skb->nh.ipv6h;
        struct ipv6_opt_hdr *exthdr;
-       u8 nexthdr = skb->nh.raw[IP6CB(skb)->nhoff];
+       u8 nexthdr = skb->nh.ipv6h->nexthdr;
 
        memset(fl, 0, sizeof(struct flowi));
        ipv6_addr_copy(&fl->fl6_dst, &hdr->daddr);