From 4d08a888be9fd1d7ef6ae98615d2c98ae1e54ffc Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Tue, 4 Dec 2007 23:51:48 -0800 Subject: [PATCH] --- yaml --- r: 78297 b: refs/heads/master c: 193b23c5a0b270f045a4e77545e9020bfe73d5c4 h: refs/heads/master i: 78295: 4f5e6cfb65d0f803e5a9ad27265505f1981e9017 v: v3 --- [refs] | 2 +- trunk/net/netfilter/xt_hashlimit.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 93d38276359a..27e47091b44e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 17dfc93f6d7e5792c9c36dd70c8612721a091ae8 +refs/heads/master: 193b23c5a0b270f045a4e77545e9020bfe73d5c4 diff --git a/trunk/net/netfilter/xt_hashlimit.c b/trunk/net/netfilter/xt_hashlimit.c index 49a9e691dc18..951d4c829674 100644 --- a/trunk/net/netfilter/xt_hashlimit.c +++ b/trunk/net/netfilter/xt_hashlimit.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -379,7 +380,7 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo, const struct sk_buff *skb, unsigned int protoff) { __be16 _ports[2], *ports; - int nexthdr; + u8 nexthdr; memset(dst, 0, sizeof(*dst)); @@ -407,8 +408,9 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo, if (!(hinfo->cfg.mode & (XT_HASHLIMIT_HASH_DPT | XT_HASHLIMIT_HASH_SPT))) return 0; - nexthdr = ipv6_find_hdr(skb, &protoff, -1, NULL); - if (nexthdr < 0) + nexthdr = ipv6_hdr(skb)->nexthdr; + protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr); + if ((int)protoff < 0) return -1; break; #endif