diff options
-rw-r--r-- | net/netfilter/xt_hashlimit.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 49a9e691dc18..951d4c829674 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/in.h> | 21 | #include <linux/in.h> |
22 | #include <linux/ip.h> | 22 | #include <linux/ip.h> |
23 | #include <linux/ipv6.h> | 23 | #include <linux/ipv6.h> |
24 | #include <net/ipv6.h> | ||
24 | #include <net/net_namespace.h> | 25 | #include <net/net_namespace.h> |
25 | 26 | ||
26 | #include <linux/netfilter/x_tables.h> | 27 | #include <linux/netfilter/x_tables.h> |
@@ -379,7 +380,7 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo, | |||
379 | const struct sk_buff *skb, unsigned int protoff) | 380 | const struct sk_buff *skb, unsigned int protoff) |
380 | { | 381 | { |
381 | __be16 _ports[2], *ports; | 382 | __be16 _ports[2], *ports; |
382 | int nexthdr; | 383 | u8 nexthdr; |
383 | 384 | ||
384 | memset(dst, 0, sizeof(*dst)); | 385 | memset(dst, 0, sizeof(*dst)); |
385 | 386 | ||
@@ -407,8 +408,9 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo, | |||
407 | if (!(hinfo->cfg.mode & | 408 | if (!(hinfo->cfg.mode & |
408 | (XT_HASHLIMIT_HASH_DPT | XT_HASHLIMIT_HASH_SPT))) | 409 | (XT_HASHLIMIT_HASH_DPT | XT_HASHLIMIT_HASH_SPT))) |
409 | return 0; | 410 | return 0; |
410 | nexthdr = ipv6_find_hdr(skb, &protoff, -1, NULL); | 411 | nexthdr = ipv6_hdr(skb)->nexthdr; |
411 | if (nexthdr < 0) | 412 | protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr); |
413 | if ((int)protoff < 0) | ||
412 | return -1; | 414 | return -1; |
413 | break; | 415 | break; |
414 | #endif | 416 | #endif |