* [PATCH] [XFRM/IPV6] fix next header offset in decode_session
@ 2006-11-07 9:30 Jean-Philippe Andriot
2006-11-07 9:48 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 1 reply; 2+ messages in thread
From: Jean-Philippe Andriot @ 2006-11-07 9:30 UTC (permalink / raw)
To: netdev
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 <jean-philippe.andriot@6wind.com>
--- 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);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] [XFRM/IPV6] fix next header offset in decode_session
2006-11-07 9:30 [PATCH] [XFRM/IPV6] fix next header offset in decode_session Jean-Philippe Andriot
@ 2006-11-07 9:48 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 0 replies; 2+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2006-11-07 9:48 UTC (permalink / raw)
To: jean-philippe.andriot; +Cc: netdev, yoshfuji
In article <20061107093002.GA6576@palpatine.dev.6wind.com> (at Tue, 7 Nov 2006 10:30:02 +0100), Jean-Philippe Andriot <jean-philippe.andriot@6WIND.com> says:
> 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.
:
> 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));
I disagree.
If you do this, you refer to the first extension headers only.
We need to skip preceding extension headers using IP6CB(skb)->nhoff,
which holds the offset to the current nexthdr.
--yoshfuji
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-11-07 9:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-07 9:30 [PATCH] [XFRM/IPV6] fix next header offset in decode_session Jean-Philippe Andriot
2006-11-07 9:48 ` YOSHIFUJI Hideaki / 吉藤英明
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).