Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 413
b: refs/heads/master
c: 0d3d077
h: refs/heads/master
i:
  411: a4800e1
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Apr 25, 2005
1 parent 706c957 commit 7ab53b8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 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: aa77d26961fa4ecb11fe4209578dcd62ad15819d
refs/heads/master: 0d3d077cd4f1154e63a9858e47fe3fb1ad0c03e5
2 changes: 1 addition & 1 deletion trunk/include/net/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ extern void ipv6_push_frag_opts(struct sk_buff *skb,
u8 *proto);

extern int ipv6_skip_exthdr(const struct sk_buff *, int start,
u8 *nexthdrp, int len);
u8 *nexthdrp);

extern int ipv6_ext_hdr(u8 nexthdr);

Expand Down
11 changes: 4 additions & 7 deletions trunk/net/ipv6/exthdrs_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ int ipv6_ext_hdr(u8 nexthdr)
* when Linux implements ESP (and maybe AUTH) headers.
* --AK
*
* This function parses (probably truncated) exthdr set "hdr"
* of length "len". "nexthdrp" initially points to some place,
* This function parses (probably truncated) exthdr set "hdr".
* "nexthdrp" initially points to some place,
* where type of the first header can be found.
*
* It skips all well-known exthdrs, and returns pointer to the start
Expand All @@ -63,21 +63,19 @@ int ipv6_ext_hdr(u8 nexthdr)
* --ANK (980726)
*/

int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp, int len)
int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp)
{
u8 nexthdr = *nexthdrp;

while (ipv6_ext_hdr(nexthdr)) {
struct ipv6_opt_hdr _hdr, *hp;
int hdrlen;

if (len < (int)sizeof(struct ipv6_opt_hdr))
return -1;
if (nexthdr == NEXTHDR_NONE)
return -1;
hp = skb_header_pointer(skb, start, sizeof(_hdr), &_hdr);
if (hp == NULL)
BUG();
return -1;
if (nexthdr == NEXTHDR_FRAGMENT) {
unsigned short _frag_off, *fp;
fp = skb_header_pointer(skb,
Expand All @@ -97,7 +95,6 @@ int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp, int len
hdrlen = ipv6_optlen(hp);

nexthdr = hp->nexthdr;
len -= hdrlen;
start += hdrlen;
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv6/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static int is_ineligible(struct sk_buff *skb)
if (len < 0)
return 1;

ptr = ipv6_skip_exthdr(skb, ptr, &nexthdr, len);
ptr = ipv6_skip_exthdr(skb, ptr, &nexthdr);
if (ptr < 0)
return 0;
if (nexthdr == IPPROTO_ICMPV6) {
Expand Down Expand Up @@ -514,7 +514,7 @@ static void icmpv6_notify(struct sk_buff *skb, int type, int code, u32 info)
nexthdr = ((struct ipv6hdr *)skb->data)->nexthdr;
if (ipv6_ext_hdr(nexthdr)) {
/* now skip over extension headers */
inner_offset = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr, skb->len - sizeof(struct ipv6hdr));
inner_offset = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr);
if (inner_offset<0)
return;
} else {
Expand Down
3 changes: 1 addition & 2 deletions trunk/security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -2855,8 +2855,7 @@ static int selinux_parse_skb_ipv6(struct sk_buff *skb, struct avc_audit_data *ad

nexthdr = ip6->nexthdr;
offset += sizeof(_ipv6h);
offset = ipv6_skip_exthdr(skb, offset, &nexthdr,
skb->tail - skb->head - offset);
offset = ipv6_skip_exthdr(skb, offset, &nexthdr);
if (offset < 0)
goto out;

Expand Down

0 comments on commit 7ab53b8

Please sign in to comment.