diff options
Diffstat (limited to 'net/ipv6/netfilter/ip6_tables.c')
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 94874b0bdcd..14cb310064f 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -2292,16 +2292,15 @@ static void __exit ip6_tables_fini(void) | |||
2292 | * "No next header". | 2292 | * "No next header". |
2293 | * | 2293 | * |
2294 | * If target header is found, its offset is set in *offset and return protocol | 2294 | * If target header is found, its offset is set in *offset and return protocol |
2295 | * number. Otherwise, return -1. | 2295 | * number. Otherwise, return -ENOENT or -EBADMSG. |
2296 | * | 2296 | * |
2297 | * If the first fragment doesn't contain the final protocol header or | 2297 | * If the first fragment doesn't contain the final protocol header or |
2298 | * NEXTHDR_NONE it is considered invalid. | 2298 | * NEXTHDR_NONE it is considered invalid. |
2299 | * | 2299 | * |
2300 | * Note that non-1st fragment is special case that "the protocol number | 2300 | * Note that non-1st fragment is special case that "the protocol number |
2301 | * of last header" is "next header" field in Fragment header. In this case, | 2301 | * of last header" is "next header" field in Fragment header. In this case, |
2302 | * *offset is meaningless and fragment offset is stored in *fragoff if fragoff | 2302 | * *offset is meaningless. If fragoff is not NULL, the fragment offset is |
2303 | * isn't NULL. | 2303 | * stored in *fragoff; if it is NULL, return -EINVAL. |
2304 | * | ||
2305 | */ | 2304 | */ |
2306 | int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, | 2305 | int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, |
2307 | int target, unsigned short *fragoff) | 2306 | int target, unsigned short *fragoff) |
@@ -2342,9 +2341,12 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, | |||
2342 | if (target < 0 && | 2341 | if (target < 0 && |
2343 | ((!ipv6_ext_hdr(hp->nexthdr)) || | 2342 | ((!ipv6_ext_hdr(hp->nexthdr)) || |
2344 | hp->nexthdr == NEXTHDR_NONE)) { | 2343 | hp->nexthdr == NEXTHDR_NONE)) { |
2345 | if (fragoff) | 2344 | if (fragoff) { |
2346 | *fragoff = _frag_off; | 2345 | *fragoff = _frag_off; |
2347 | return hp->nexthdr; | 2346 | return hp->nexthdr; |
2347 | } else { | ||
2348 | return -EINVAL; | ||
2349 | } | ||
2348 | } | 2350 | } |
2349 | return -ENOENT; | 2351 | return -ENOENT; |
2350 | } | 2352 | } |