aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/xt_helper.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2008-10-08 05:35:20 -0400
committerPatrick McHardy <kaber@trash.net>2008-10-08 05:35:20 -0400
commit92f3b2b1bc968caaabee8cd78bee75ab7c4af74e (patch)
tree02f5884407a858908e4c74c66f9c213c617d3353 /net/netfilter/xt_helper.c
parent916a917dfec18535ff9e2afdafba82e6279eb4f4 (diff)
netfilter: xtables: cut down on static data for family-independent extensions
Using ->family in struct xt_*_param, multiple struct xt_{match,target} can be squashed together. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/netfilter/xt_helper.c')
-rw-r--r--net/netfilter/xt_helper.c38
1 files changed, 14 insertions, 24 deletions
diff --git a/net/netfilter/xt_helper.c b/net/netfilter/xt_helper.c
index 280c984349f..64fc7f27722 100644
--- a/net/netfilter/xt_helper.c
+++ b/net/netfilter/xt_helper.c
@@ -58,9 +58,9 @@ static bool helper_mt_check(const struct xt_mtchk_param *par)
58{ 58{
59 struct xt_helper_info *info = par->matchinfo; 59 struct xt_helper_info *info = par->matchinfo;
60 60
61 if (nf_ct_l3proto_try_module_get(par->match->family) < 0) { 61 if (nf_ct_l3proto_try_module_get(par->family) < 0) {
62 printk(KERN_WARNING "can't load conntrack support for " 62 printk(KERN_WARNING "can't load conntrack support for "
63 "proto=%u\n", par->match->family); 63 "proto=%u\n", par->family);
64 return false; 64 return false;
65 } 65 }
66 info->name[29] = '\0'; 66 info->name[29] = '\0';
@@ -69,38 +69,28 @@ static bool helper_mt_check(const struct xt_mtchk_param *par)
69 69
70static void helper_mt_destroy(const struct xt_mtdtor_param *par) 70static void helper_mt_destroy(const struct xt_mtdtor_param *par)
71{ 71{
72 nf_ct_l3proto_module_put(par->match->family); 72 nf_ct_l3proto_module_put(par->family);
73} 73}
74 74
75static struct xt_match helper_mt_reg[] __read_mostly = { 75static struct xt_match helper_mt_reg __read_mostly = {
76 { 76 .name = "helper",
77 .name = "helper", 77 .revision = 0,
78 .family = NFPROTO_IPV4, 78 .family = NFPROTO_UNSPEC,
79 .checkentry = helper_mt_check, 79 .checkentry = helper_mt_check,
80 .match = helper_mt, 80 .match = helper_mt,
81 .destroy = helper_mt_destroy, 81 .destroy = helper_mt_destroy,
82 .matchsize = sizeof(struct xt_helper_info), 82 .matchsize = sizeof(struct xt_helper_info),
83 .me = THIS_MODULE, 83 .me = THIS_MODULE,
84 },
85 {
86 .name = "helper",
87 .family = NFPROTO_IPV6,
88 .checkentry = helper_mt_check,
89 .match = helper_mt,
90 .destroy = helper_mt_destroy,
91 .matchsize = sizeof(struct xt_helper_info),
92 .me = THIS_MODULE,
93 },
94}; 84};
95 85
96static int __init helper_mt_init(void) 86static int __init helper_mt_init(void)
97{ 87{
98 return xt_register_matches(helper_mt_reg, ARRAY_SIZE(helper_mt_reg)); 88 return xt_register_match(&helper_mt_reg);
99} 89}
100 90
101static void __exit helper_mt_exit(void) 91static void __exit helper_mt_exit(void)
102{ 92{
103 xt_unregister_matches(helper_mt_reg, ARRAY_SIZE(helper_mt_reg)); 93 xt_unregister_match(&helper_mt_reg);
104} 94}
105 95
106module_init(helper_mt_init); 96module_init(helper_mt_init);