Skip to content

Commit

Permalink
[IPV6] XFRM: Don't use old copy of pointer after pskb_may_pull().
Browse files Browse the repository at this point in the history
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
YOSHIFUJI Hideaki authored and David S. Miller committed Apr 18, 2006
1 parent ec67009 commit e3cae90
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ipv6/xfrm6_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,16 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl)
{
u16 offset = sizeof(struct ipv6hdr);
struct ipv6hdr *hdr = skb->nh.ipv6h;
struct ipv6_opt_hdr *exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
struct ipv6_opt_hdr *exthdr;
u8 nexthdr = skb->nh.ipv6h->nexthdr;

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:
Expand Down

0 comments on commit e3cae90

Please sign in to comment.