diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2008-10-08 05:35:20 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2008-10-08 05:35:20 -0400 |
commit | 92f3b2b1bc968caaabee8cd78bee75ab7c4af74e (patch) | |
tree | 02f5884407a858908e4c74c66f9c213c617d3353 /net/netfilter/xt_connmark.c | |
parent | 916a917dfec18535ff9e2afdafba82e6279eb4f4 (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_connmark.c')
-rw-r--r-- | net/netfilter/xt_connmark.c | 39 |
1 files changed, 7 insertions, 32 deletions
diff --git a/net/netfilter/xt_connmark.c b/net/netfilter/xt_connmark.c index c708577ea1b..86cacab7a4a 100644 --- a/net/netfilter/xt_connmark.c +++ b/net/netfilter/xt_connmark.c | |||
@@ -69,9 +69,9 @@ static bool connmark_mt_check_v0(const struct xt_mtchk_param *par) | |||
69 | printk(KERN_WARNING "connmark: only support 32bit mark\n"); | 69 | printk(KERN_WARNING "connmark: only support 32bit mark\n"); |
70 | return false; | 70 | return false; |
71 | } | 71 | } |
72 | if (nf_ct_l3proto_try_module_get(par->match->family) < 0) { | 72 | if (nf_ct_l3proto_try_module_get(par->family) < 0) { |
73 | printk(KERN_WARNING "can't load conntrack support for " | 73 | printk(KERN_WARNING "can't load conntrack support for " |
74 | "proto=%u\n", par->match->family); | 74 | "proto=%u\n", par->family); |
75 | return false; | 75 | return false; |
76 | } | 76 | } |
77 | return true; | 77 | return true; |
@@ -79,9 +79,9 @@ static bool connmark_mt_check_v0(const struct xt_mtchk_param *par) | |||
79 | 79 | ||
80 | static bool connmark_mt_check(const struct xt_mtchk_param *par) | 80 | static bool connmark_mt_check(const struct xt_mtchk_param *par) |
81 | { | 81 | { |
82 | if (nf_ct_l3proto_try_module_get(par->match->family) < 0) { | 82 | if (nf_ct_l3proto_try_module_get(par->family) < 0) { |
83 | printk(KERN_WARNING "cannot load conntrack support for " | 83 | printk(KERN_WARNING "cannot load conntrack support for " |
84 | "proto=%u\n", par->match->family); | 84 | "proto=%u\n", par->family); |
85 | return false; | 85 | return false; |
86 | } | 86 | } |
87 | return true; | 87 | return true; |
@@ -89,7 +89,7 @@ static bool connmark_mt_check(const struct xt_mtchk_param *par) | |||
89 | 89 | ||
90 | static void connmark_mt_destroy(const struct xt_mtdtor_param *par) | 90 | static void connmark_mt_destroy(const struct xt_mtdtor_param *par) |
91 | { | 91 | { |
92 | nf_ct_l3proto_module_put(par->match->family); | 92 | nf_ct_l3proto_module_put(par->family); |
93 | } | 93 | } |
94 | 94 | ||
95 | #ifdef CONFIG_COMPAT | 95 | #ifdef CONFIG_COMPAT |
@@ -127,7 +127,7 @@ static struct xt_match connmark_mt_reg[] __read_mostly = { | |||
127 | { | 127 | { |
128 | .name = "connmark", | 128 | .name = "connmark", |
129 | .revision = 0, | 129 | .revision = 0, |
130 | .family = NFPROTO_IPV4, | 130 | .family = NFPROTO_UNSPEC, |
131 | .checkentry = connmark_mt_check_v0, | 131 | .checkentry = connmark_mt_check_v0, |
132 | .match = connmark_mt_v0, | 132 | .match = connmark_mt_v0, |
133 | .destroy = connmark_mt_destroy, | 133 | .destroy = connmark_mt_destroy, |
@@ -140,34 +140,9 @@ static struct xt_match connmark_mt_reg[] __read_mostly = { | |||
140 | .me = THIS_MODULE | 140 | .me = THIS_MODULE |
141 | }, | 141 | }, |
142 | { | 142 | { |
143 | .name = "connmark", | ||
144 | .revision = 0, | ||
145 | .family = NFPROTO_IPV6, | ||
146 | .checkentry = connmark_mt_check_v0, | ||
147 | .match = connmark_mt_v0, | ||
148 | .destroy = connmark_mt_destroy, | ||
149 | .matchsize = sizeof(struct xt_connmark_info), | ||
150 | #ifdef CONFIG_COMPAT | ||
151 | .compatsize = sizeof(struct compat_xt_connmark_info), | ||
152 | .compat_from_user = connmark_mt_compat_from_user_v0, | ||
153 | .compat_to_user = connmark_mt_compat_to_user_v0, | ||
154 | #endif | ||
155 | .me = THIS_MODULE | ||
156 | }, | ||
157 | { | ||
158 | .name = "connmark", | ||
159 | .revision = 1, | ||
160 | .family = NFPROTO_IPV4, | ||
161 | .checkentry = connmark_mt_check, | ||
162 | .match = connmark_mt, | ||
163 | .matchsize = sizeof(struct xt_connmark_mtinfo1), | ||
164 | .destroy = connmark_mt_destroy, | ||
165 | .me = THIS_MODULE, | ||
166 | }, | ||
167 | { | ||
168 | .name = "connmark", | 143 | .name = "connmark", |
169 | .revision = 1, | 144 | .revision = 1, |
170 | .family = NFPROTO_IPV6, | 145 | .family = NFPROTO_UNSPEC, |
171 | .checkentry = connmark_mt_check, | 146 | .checkentry = connmark_mt_check, |
172 | .match = connmark_mt, | 147 | .match = connmark_mt, |
173 | .matchsize = sizeof(struct xt_connmark_mtinfo1), | 148 | .matchsize = sizeof(struct xt_connmark_mtinfo1), |