aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/xt_hashlimit.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2008-10-08 05:35:18 -0400
committerPatrick McHardy <kaber@trash.net>2008-10-08 05:35:18 -0400
commit9b4fce7a3508a9776534188b6065b206a9608ccf (patch)
tree7df90f099a72738900deb93124ad86724a2df207 /net/netfilter/xt_hashlimit.c
parentf7108a20dee44e5bb037f9e48f6a207b42e6ae1c (diff)
netfilter: xtables: move extension arguments into compound structure (2/6)
This patch does this for match extensions' checkentry functions. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/netfilter/xt_hashlimit.c')
-rw-r--r--net/netfilter/xt_hashlimit.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 22a60a728cf..2f73820e46d 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -664,12 +664,9 @@ hashlimit_mt(const struct sk_buff *skb, const struct xt_match_param *par)
664 return false; 664 return false;
665} 665}
666 666
667static bool 667static bool hashlimit_mt_check_v0(const struct xt_mtchk_param *par)
668hashlimit_mt_check_v0(const char *tablename, const void *inf,
669 const struct xt_match *match, void *matchinfo,
670 unsigned int hook_mask)
671{ 668{
672 struct xt_hashlimit_info *r = matchinfo; 669 struct xt_hashlimit_info *r = par->matchinfo;
673 670
674 /* Check for overflow. */ 671 /* Check for overflow. */
675 if (r->cfg.burst == 0 || 672 if (r->cfg.burst == 0 ||
@@ -698,8 +695,8 @@ hashlimit_mt_check_v0(const char *tablename, const void *inf,
698 * the list of htable's in htable_create(), since then we would 695 * the list of htable's in htable_create(), since then we would
699 * create duplicate proc files. -HW */ 696 * create duplicate proc files. -HW */
700 mutex_lock(&hlimit_mutex); 697 mutex_lock(&hlimit_mutex);
701 r->hinfo = htable_find_get(r->name, match->family); 698 r->hinfo = htable_find_get(r->name, par->match->family);
702 if (!r->hinfo && htable_create_v0(r, match->family) != 0) { 699 if (!r->hinfo && htable_create_v0(r, par->match->family) != 0) {
703 mutex_unlock(&hlimit_mutex); 700 mutex_unlock(&hlimit_mutex);
704 return false; 701 return false;
705 } 702 }
@@ -710,12 +707,9 @@ hashlimit_mt_check_v0(const char *tablename, const void *inf,
710 return true; 707 return true;
711} 708}
712 709
713static bool 710static bool hashlimit_mt_check(const struct xt_mtchk_param *par)
714hashlimit_mt_check(const char *tablename, const void *inf,
715 const struct xt_match *match, void *matchinfo,
716 unsigned int hook_mask)
717{ 711{
718 struct xt_hashlimit_mtinfo1 *info = matchinfo; 712 struct xt_hashlimit_mtinfo1 *info = par->matchinfo;
719 713
720 /* Check for overflow. */ 714 /* Check for overflow. */
721 if (info->cfg.burst == 0 || 715 if (info->cfg.burst == 0 ||
@@ -729,7 +723,7 @@ hashlimit_mt_check(const char *tablename, const void *inf,
729 return false; 723 return false;
730 if (info->name[sizeof(info->name)-1] != '\0') 724 if (info->name[sizeof(info->name)-1] != '\0')
731 return false; 725 return false;
732 if (match->family == NFPROTO_IPV4) { 726 if (par->match->family == NFPROTO_IPV4) {
733 if (info->cfg.srcmask > 32 || info->cfg.dstmask > 32) 727 if (info->cfg.srcmask > 32 || info->cfg.dstmask > 32)
734 return false; 728 return false;
735 } else { 729 } else {
@@ -744,8 +738,8 @@ hashlimit_mt_check(const char *tablename, const void *inf,
744 * the list of htable's in htable_create(), since then we would 738 * the list of htable's in htable_create(), since then we would
745 * create duplicate proc files. -HW */ 739 * create duplicate proc files. -HW */
746 mutex_lock(&hlimit_mutex); 740 mutex_lock(&hlimit_mutex);
747 info->hinfo = htable_find_get(info->name, match->family); 741 info->hinfo = htable_find_get(info->name, par->match->family);
748 if (!info->hinfo && htable_create(info, match->family) != 0) { 742 if (!info->hinfo && htable_create(info, par->match->family) != 0) {
749 mutex_unlock(&hlimit_mutex); 743 mutex_unlock(&hlimit_mutex);
750 return false; 744 return false;
751 } 745 }