diff options
author | Changli Gao <xiaosuo@gmail.com> | 2010-08-17 15:06:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-19 20:16:25 -0400 |
commit | aca071c1c1c07bcc0b100b7c58e59790d6be6a69 (patch) | |
tree | 838cc780da30b1b06365f5feedac96ec164b1902 /net | |
parent | 3d04ebb6ab2ac9a3bea7644f0d13cdf65002b870 (diff) |
netfilter: xt_hashlimit: use proto_ports_offset() to support AH message
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/xt_hashlimit.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index b46a8390896d..9228ee0dc11a 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -448,6 +448,7 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo, | |||
448 | { | 448 | { |
449 | __be16 _ports[2], *ports; | 449 | __be16 _ports[2], *ports; |
450 | u8 nexthdr; | 450 | u8 nexthdr; |
451 | int poff; | ||
451 | 452 | ||
452 | memset(dst, 0, sizeof(*dst)); | 453 | memset(dst, 0, sizeof(*dst)); |
453 | 454 | ||
@@ -492,19 +493,13 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo, | |||
492 | return 0; | 493 | return 0; |
493 | } | 494 | } |
494 | 495 | ||
495 | switch (nexthdr) { | 496 | poff = proto_ports_offset(nexthdr); |
496 | case IPPROTO_TCP: | 497 | if (poff >= 0) { |
497 | case IPPROTO_UDP: | 498 | ports = skb_header_pointer(skb, protoff + poff, sizeof(_ports), |
498 | case IPPROTO_UDPLITE: | ||
499 | case IPPROTO_SCTP: | ||
500 | case IPPROTO_DCCP: | ||
501 | ports = skb_header_pointer(skb, protoff, sizeof(_ports), | ||
502 | &_ports); | 499 | &_ports); |
503 | break; | 500 | } else { |
504 | default: | ||
505 | _ports[0] = _ports[1] = 0; | 501 | _ports[0] = _ports[1] = 0; |
506 | ports = _ports; | 502 | ports = _ports; |
507 | break; | ||
508 | } | 503 | } |
509 | if (!ports) | 504 | if (!ports) |
510 | return -1; | 505 | return -1; |