Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71287
b: refs/heads/master
c: 4407250
h: refs/heads/master
i:
  71285: 1a9a321
  71283: 4287a40
  71279: 40d2394
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Oct 18, 2007
1 parent 0ffd5fc commit 7fc7bda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7aa68cb90638ccc36559a936814e4c089892b3d9
refs/heads/master: 440725000cba0b1a68ca2df20124be3a5b7f7702
5 changes: 4 additions & 1 deletion trunk/net/xfrm/xfrm_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@ EXPORT_SYMBOL(secpath_dup);
int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq)
{
int offset, offset_seq;
int hlen;

switch (nexthdr) {
case IPPROTO_AH:
hlen = sizeof(struct ip_auth_hdr);
offset = offsetof(struct ip_auth_hdr, spi);
offset_seq = offsetof(struct ip_auth_hdr, seq_no);
break;
case IPPROTO_ESP:
hlen = sizeof(struct ip_esp_hdr);
offset = offsetof(struct ip_esp_hdr, spi);
offset_seq = offsetof(struct ip_esp_hdr, seq_no);
break;
Expand All @@ -69,7 +72,7 @@ int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq)
return 1;
}

if (!pskb_may_pull(skb, 16))
if (!pskb_may_pull(skb, hlen))
return -EINVAL;

*spi = *(__be32*)(skb_transport_header(skb) + offset);
Expand Down

0 comments on commit 7fc7bda

Please sign in to comment.