git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
net
/
ipv4
/
netfilter
/
arp_tables.c
diff --git
a/net/ipv4/netfilter/arp_tables.c
b/net/ipv4/netfilter/arp_tables.c
index
8d1d7a6
..
dbbda6b
100644
(file)
--- a/
net/ipv4/netfilter/arp_tables.c
+++ b/
net/ipv4/netfilter/arp_tables.c
@@
-9,6
+9,7
@@
*
*/
*
*/
+#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
@@
-21,7
+22,7
@@
#include <linux/init.h>
#include <asm/uaccess.h>
#include <linux/init.h>
#include <asm/uaccess.h>
-#include <
linux/mutex
.h>
+#include <
asm/semaphore
.h>
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter_arp/arp_tables.h>
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter_arp/arp_tables.h>
@@
-207,7
+208,6
@@
static unsigned int arpt_error(struct sk_buff **pskb,
const struct net_device *in,
const struct net_device *out,
unsigned int hooknum,
const struct net_device *in,
const struct net_device *out,
unsigned int hooknum,
- const struct xt_target *target,
const void *targinfo,
void *userinfo)
{
const void *targinfo,
void *userinfo)
{
@@
-301,7
+301,6
@@
unsigned int arpt_do_table(struct sk_buff **pskb,
verdict = t->u.kernel.target->target(pskb,
in, out,
hook,
verdict = t->u.kernel.target->target(pskb,
in, out,
hook,
- t->u.kernel.target,
t->data,
userdata);
t->data,
userdata);
@@
-482,31
+481,26
@@
static inline int check_entry(struct arpt_entry *e, const char *name, unsigned i
}
t->u.kernel.target = target;
}
t->u.kernel.target = target;
- ret = xt_check_target(target, NF_ARP, t->u.target_size - sizeof(*t),
- name, e->comefrom, 0, 0);
- if (ret)
- goto err;
-
if (t->u.kernel.target == &arpt_standard_target) {
if (!standard_check(t, size)) {
ret = -EINVAL;
goto out;
}
} else if (t->u.kernel.target->checkentry
if (t->u.kernel.target == &arpt_standard_target) {
if (!standard_check(t, size)) {
ret = -EINVAL;
goto out;
}
} else if (t->u.kernel.target->checkentry
- && !t->u.kernel.target->checkentry(name, e, t
arget, t
->data,
+ && !t->u.kernel.target->checkentry(name, e, t->data,
t->u.target_size
- sizeof(*t),
e->comefrom)) {
t->u.target_size
- sizeof(*t),
e->comefrom)) {
+ module_put(t->u.kernel.target->me);
duprintf("arp_tables: check failed for `%s'.\n",
t->u.kernel.target->name);
ret = -EINVAL;
duprintf("arp_tables: check failed for `%s'.\n",
t->u.kernel.target->name);
ret = -EINVAL;
- goto
err
;
+ goto
out
;
}
(*i)++;
return 0;
}
(*i)++;
return 0;
-err:
- module_put(t->u.kernel.target->me);
+
out:
return ret;
}
out:
return ret;
}
@@
-562,7
+556,7
@@
static inline int cleanup_entry(struct arpt_entry *e, unsigned int *i)
t = arpt_get_target(e);
if (t->u.kernel.target->destroy)
t = arpt_get_target(e);
if (t->u.kernel.target->destroy)
- t->u.kernel.target->destroy(t->
u.kernel.target, t->
data,
+ t->u.kernel.target->destroy(t->data,
t->u.target_size - sizeof(*t));
module_put(t->u.kernel.target->me);
return 0;
t->u.target_size - sizeof(*t));
module_put(t->u.kernel.target->me);
return 0;
@@
-646,7
+640,7
@@
static int translate_table(const char *name,
}
/* And one copy for every other CPU */
}
/* And one copy for every other CPU */
- for_each_
possible_
cpu(i) {
+ for_each_cpu(i) {
if (newinfo->entries[i] && newinfo->entries[i] != entry0)
memcpy(newinfo->entries[i], entry0, newinfo->size);
}
if (newinfo->entries[i] && newinfo->entries[i] != entry0)
memcpy(newinfo->entries[i], entry0, newinfo->size);
}
@@
-696,7
+690,7
@@
static void get_counters(const struct xt_table_info *t,
counters,
&i);
counters,
&i);
- for_each_
possible_
cpu(cpu) {
+ for_each_cpu(cpu) {
if (cpu == curcpu)
continue;
i = 0;
if (cpu == curcpu)
continue;
i = 0;
@@
-1120,8
+1114,7
@@
int arpt_register_table(struct arpt_table *table,
return ret;
}
return ret;
}
- ret = xt_register_table(table, &bootstrap, newinfo);
- if (ret != 0) {
+ if (xt_register_table(table, &bootstrap, newinfo) != 0) {
xt_free_table_info(newinfo);
return ret;
}
xt_free_table_info(newinfo);
return ret;
}
@@
-1146,15
+1139,11
@@
void arpt_unregister_table(struct arpt_table *table)
/* The built-in targets: standard (NULL) and error. */
static struct arpt_target arpt_standard_target = {
.name = ARPT_STANDARD_TARGET,
/* The built-in targets: standard (NULL) and error. */
static struct arpt_target arpt_standard_target = {
.name = ARPT_STANDARD_TARGET,
- .targetsize = sizeof(int),
- .family = NF_ARP,
};
static struct arpt_target arpt_error_target = {
.name = ARPT_ERROR_TARGET,
.target = arpt_error,
};
static struct arpt_target arpt_error_target = {
.name = ARPT_ERROR_TARGET,
.target = arpt_error,
- .targetsize = ARPT_FUNCTION_MAXNAMELEN,
- .family = NF_ARP,
};
static struct nf_sockopt_ops arpt_sockopts = {
};
static struct nf_sockopt_ops arpt_sockopts = {
@@
-1167,41
+1156,28
@@
static struct nf_sockopt_ops arpt_sockopts = {
.get = do_arpt_get_ctl,
};
.get = do_arpt_get_ctl,
};
-static int __init
arp_tables_
init(void)
+static int __init init(void)
{
int ret;
{
int ret;
- ret = xt_proto_init(NF_ARP);
- if (ret < 0)
- goto err1;
+ xt_proto_init(NF_ARP);
/* Noone else will be downing sem now, so we won't sleep */
/* Noone else will be downing sem now, so we won't sleep */
- ret = xt_register_target(&arpt_standard_target);
- if (ret < 0)
- goto err2;
- ret = xt_register_target(&arpt_error_target);
- if (ret < 0)
- goto err3;
+ xt_register_target(NF_ARP, &arpt_standard_target);
+ xt_register_target(NF_ARP, &arpt_error_target);
/* Register setsockopt */
ret = nf_register_sockopt(&arpt_sockopts);
/* Register setsockopt */
ret = nf_register_sockopt(&arpt_sockopts);
- if (ret < 0)
- goto err4;
+ if (ret < 0) {
+ duprintf("Unable to register sockopts.\n");
+ return ret;
+ }
printk("arp_tables: (C) 2002 David S. Miller\n");
return 0;
printk("arp_tables: (C) 2002 David S. Miller\n");
return 0;
-
-err4:
- xt_unregister_target(&arpt_error_target);
-err3:
- xt_unregister_target(&arpt_standard_target);
-err2:
- xt_proto_fini(NF_ARP);
-err1:
- return ret;
}
}
-static void __exit
arp_tables_
fini(void)
+static void __exit fini(void)
{
nf_unregister_sockopt(&arpt_sockopts);
xt_proto_fini(NF_ARP);
{
nf_unregister_sockopt(&arpt_sockopts);
xt_proto_fini(NF_ARP);
@@
-1211,5
+1187,5
@@
EXPORT_SYMBOL(arpt_register_table);
EXPORT_SYMBOL(arpt_unregister_table);
EXPORT_SYMBOL(arpt_do_table);
EXPORT_SYMBOL(arpt_unregister_table);
EXPORT_SYMBOL(arpt_do_table);
-module_init(
arp_tables_
init);
-module_exit(
arp_tables_
fini);
+module_init(init);
+module_exit(fini);