diff options
Diffstat (limited to 'net/ipv6/exthdrs_core.c')
-rw-r--r-- | net/ipv6/exthdrs_core.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/net/ipv6/exthdrs_core.c b/net/ipv6/exthdrs_core.c index 6dda815c013..315bc1fbec3 100644 --- a/net/ipv6/exthdrs_core.c +++ b/net/ipv6/exthdrs_core.c | |||
@@ -41,8 +41,8 @@ int ipv6_ext_hdr(u8 nexthdr) | |||
41 | * when Linux implements ESP (and maybe AUTH) headers. | 41 | * when Linux implements ESP (and maybe AUTH) headers. |
42 | * --AK | 42 | * --AK |
43 | * | 43 | * |
44 | * This function parses (probably truncated) exthdr set "hdr" | 44 | * This function parses (probably truncated) exthdr set "hdr". |
45 | * of length "len". "nexthdrp" initially points to some place, | 45 | * "nexthdrp" initially points to some place, |
46 | * where type of the first header can be found. | 46 | * where type of the first header can be found. |
47 | * | 47 | * |
48 | * It skips all well-known exthdrs, and returns pointer to the start | 48 | * It skips all well-known exthdrs, and returns pointer to the start |
@@ -63,7 +63,7 @@ int ipv6_ext_hdr(u8 nexthdr) | |||
63 | * --ANK (980726) | 63 | * --ANK (980726) |
64 | */ | 64 | */ |
65 | 65 | ||
66 | int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp, int len) | 66 | int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp) |
67 | { | 67 | { |
68 | u8 nexthdr = *nexthdrp; | 68 | u8 nexthdr = *nexthdrp; |
69 | 69 | ||
@@ -71,13 +71,11 @@ int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp, int len | |||
71 | struct ipv6_opt_hdr _hdr, *hp; | 71 | struct ipv6_opt_hdr _hdr, *hp; |
72 | int hdrlen; | 72 | int hdrlen; |
73 | 73 | ||
74 | if (len < (int)sizeof(struct ipv6_opt_hdr)) | ||
75 | return -1; | ||
76 | if (nexthdr == NEXTHDR_NONE) | 74 | if (nexthdr == NEXTHDR_NONE) |
77 | return -1; | 75 | return -1; |
78 | hp = skb_header_pointer(skb, start, sizeof(_hdr), &_hdr); | 76 | hp = skb_header_pointer(skb, start, sizeof(_hdr), &_hdr); |
79 | if (hp == NULL) | 77 | if (hp == NULL) |
80 | BUG(); | 78 | return -1; |
81 | if (nexthdr == NEXTHDR_FRAGMENT) { | 79 | if (nexthdr == NEXTHDR_FRAGMENT) { |
82 | unsigned short _frag_off, *fp; | 80 | unsigned short _frag_off, *fp; |
83 | fp = skb_header_pointer(skb, | 81 | fp = skb_header_pointer(skb, |
@@ -97,7 +95,6 @@ int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp, int len | |||
97 | hdrlen = ipv6_optlen(hp); | 95 | hdrlen = ipv6_optlen(hp); |
98 | 96 | ||
99 | nexthdr = hp->nexthdr; | 97 | nexthdr = hp->nexthdr; |
100 | len -= hdrlen; | ||
101 | start += hdrlen; | 98 | start += hdrlen; |
102 | } | 99 | } |
103 | 100 | ||