diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2010-02-02 09:03:24 -0500 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-02-02 09:03:24 -0500 |
commit | c30f540b63047437ffa894b5353216410c480d1a (patch) | |
tree | 74a45a78d6e7f5edb09bddbf95c2afe7c96a437d /include | |
parent | 477781477a88f60c89003c852def4aedc6f78101 (diff) |
netfilter: xtables: CONFIG_COMPAT redux
Ifdef out
struct nf_sockopt_ops::compat_set
struct nf_sockopt_ops::compat_get
struct xt_match::compat_from_user
struct xt_match::compat_to_user
struct xt_match::compatsize
to make structures smaller on COMPAT=n kernels.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netfilter.h | 9 | ||||
-rw-r--r-- | include/linux/netfilter/x_tables.h | 12 |
2 files changed, 14 insertions, 7 deletions
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 48c54960773c..78f33d223680 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -114,15 +114,17 @@ struct nf_sockopt_ops { | |||
114 | int set_optmin; | 114 | int set_optmin; |
115 | int set_optmax; | 115 | int set_optmax; |
116 | int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len); | 116 | int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len); |
117 | #ifdef CONFIG_COMPAT | ||
117 | int (*compat_set)(struct sock *sk, int optval, | 118 | int (*compat_set)(struct sock *sk, int optval, |
118 | void __user *user, unsigned int len); | 119 | void __user *user, unsigned int len); |
119 | 120 | #endif | |
120 | int get_optmin; | 121 | int get_optmin; |
121 | int get_optmax; | 122 | int get_optmax; |
122 | int (*get)(struct sock *sk, int optval, void __user *user, int *len); | 123 | int (*get)(struct sock *sk, int optval, void __user *user, int *len); |
124 | #ifdef CONFIG_COMPAT | ||
123 | int (*compat_get)(struct sock *sk, int optval, | 125 | int (*compat_get)(struct sock *sk, int optval, |
124 | void __user *user, int *len); | 126 | void __user *user, int *len); |
125 | 127 | #endif | |
126 | /* Use the module struct to lock set/get code in place */ | 128 | /* Use the module struct to lock set/get code in place */ |
127 | struct module *owner; | 129 | struct module *owner; |
128 | }; | 130 | }; |
@@ -222,11 +224,12 @@ int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, | |||
222 | unsigned int len); | 224 | unsigned int len); |
223 | int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, | 225 | int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, |
224 | int *len); | 226 | int *len); |
225 | 227 | #ifdef CONFIG_COMPAT | |
226 | int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, | 228 | int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, |
227 | char __user *opt, unsigned int len); | 229 | char __user *opt, unsigned int len); |
228 | int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, | 230 | int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, |
229 | char __user *opt, int *len); | 231 | char __user *opt, int *len); |
232 | #endif | ||
230 | 233 | ||
231 | /* Call this before modifying an existing packet: ensures it is | 234 | /* Call this before modifying an existing packet: ensures it is |
232 | modifiable and linear to the point you care about (writable_len). | 235 | modifiable and linear to the point you care about (writable_len). |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 3caf5e151102..026eb78ee83c 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -283,11 +283,11 @@ struct xt_match { | |||
283 | 283 | ||
284 | /* Called when entry of this type deleted. */ | 284 | /* Called when entry of this type deleted. */ |
285 | void (*destroy)(const struct xt_mtdtor_param *); | 285 | void (*destroy)(const struct xt_mtdtor_param *); |
286 | 286 | #ifdef CONFIG_COMPAT | |
287 | /* Called when userspace align differs from kernel space one */ | 287 | /* Called when userspace align differs from kernel space one */ |
288 | void (*compat_from_user)(void *dst, void *src); | 288 | void (*compat_from_user)(void *dst, void *src); |
289 | int (*compat_to_user)(void __user *dst, void *src); | 289 | int (*compat_to_user)(void __user *dst, void *src); |
290 | 290 | #endif | |
291 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 291 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
292 | struct module *me; | 292 | struct module *me; |
293 | 293 | ||
@@ -296,7 +296,9 @@ struct xt_match { | |||
296 | 296 | ||
297 | const char *table; | 297 | const char *table; |
298 | unsigned int matchsize; | 298 | unsigned int matchsize; |
299 | #ifdef CONFIG_COMPAT | ||
299 | unsigned int compatsize; | 300 | unsigned int compatsize; |
301 | #endif | ||
300 | unsigned int hooks; | 302 | unsigned int hooks; |
301 | unsigned short proto; | 303 | unsigned short proto; |
302 | 304 | ||
@@ -323,17 +325,19 @@ struct xt_target { | |||
323 | 325 | ||
324 | /* Called when entry of this type deleted. */ | 326 | /* Called when entry of this type deleted. */ |
325 | void (*destroy)(const struct xt_tgdtor_param *); | 327 | void (*destroy)(const struct xt_tgdtor_param *); |
326 | 328 | #ifdef CONFIG_COMPAT | |
327 | /* Called when userspace align differs from kernel space one */ | 329 | /* Called when userspace align differs from kernel space one */ |
328 | void (*compat_from_user)(void *dst, void *src); | 330 | void (*compat_from_user)(void *dst, void *src); |
329 | int (*compat_to_user)(void __user *dst, void *src); | 331 | int (*compat_to_user)(void __user *dst, void *src); |
330 | 332 | #endif | |
331 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 333 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
332 | struct module *me; | 334 | struct module *me; |
333 | 335 | ||
334 | const char *table; | 336 | const char *table; |
335 | unsigned int targetsize; | 337 | unsigned int targetsize; |
338 | #ifdef CONFIG_COMPAT | ||
336 | unsigned int compatsize; | 339 | unsigned int compatsize; |
340 | #endif | ||
337 | unsigned int hooks; | 341 | unsigned int hooks; |
338 | unsigned short proto; | 342 | unsigned short proto; |
339 | 343 | ||