summaryrefslogtreecommitdiffstats
path: root/net/ipv6/xfrm6_policy.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-04-18 18:03:22 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-18 18:03:22 -0700
commit5c723d26fa223bdb17b9230c77e4e1156884475a (patch)
tree03487f55b11cdfa5d3f0edf655fa2351f7d4ed53 /net/ipv6/xfrm6_policy.c
parenta196e7880905313773be97dbca5aa7b0a0aed71c (diff)
parent63903ca6af3d9424a0c2b176f927fa7e7ab2ae8e (diff)
downloadblackbird-op-linux-5c723d26fa223bdb17b9230c77e4e1156884475a.tar.gz
blackbird-op-linux-5c723d26fa223bdb17b9230c77e4e1156884475a.zip
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [NET]: Remove redundant NULL checks before [kv]free unaligned access in sk_run_filter() [IPV6]: Clean up hop-by-hop options handler. [IPV6] XFRM: Fix decoding session with preceding extension header(s). [IPV6] XFRM: Don't use old copy of pointer after pskb_may_pull(). [IPV6]: Ensure to have hop-by-hop options in our header of &sk_buff. [TCP]: Fix truesize underflow
Diffstat (limited to 'net/ipv6/xfrm6_policy.c')
-rw-r--r--net/ipv6/xfrm6_policy.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 91cce8b2d7a5..88c840f1beb6 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -191,16 +191,18 @@ error:
static inline void
_decode_session6(struct sk_buff *skb, struct flowi *fl)
{
- u16 offset = sizeof(struct ipv6hdr);
+ u16 offset = skb->h.raw - skb->nh.raw;
struct ipv6hdr *hdr = skb->nh.ipv6h;
- struct ipv6_opt_hdr *exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
- u8 nexthdr = skb->nh.ipv6h->nexthdr;
+ struct ipv6_opt_hdr *exthdr;
+ u8 nexthdr = skb->nh.raw[IP6CB(skb)->nhoff];
memset(fl, 0, sizeof(struct flowi));
ipv6_addr_copy(&fl->fl6_dst, &hdr->daddr);
ipv6_addr_copy(&fl->fl6_src, &hdr->saddr);
while (pskb_may_pull(skb, skb->nh.raw + offset + 1 - skb->data)) {
+ exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
+
switch (nexthdr) {
case NEXTHDR_ROUTING:
case NEXTHDR_HOP:
OpenPOWER on IntegriCloud