#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>
const struct net_device *in,
const struct net_device *out,
unsigned int hooknum,
- const struct xt_target *target,
const void *targinfo,
void *userinfo)
{
verdict = t->u.kernel.target->target(pskb,
in, out,
hook,
- t->u.kernel.target,
t->data,
userdata);
}
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
- && !t->u.kernel.target->checkentry(name, e, target, t->data,
+ && !t->u.kernel.target->checkentry(name, e, t->data,
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;
- goto err;
+ goto out;
}
(*i)++;
return 0;
-err:
- module_put(t->u.kernel.target->me);
+
out:
return ret;
}
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;
}
/* 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);
}
counters,
&i);
- for_each_possible_cpu(cpu) {
+ for_each_cpu(cpu) {
if (cpu == curcpu)
continue;
i = 0;
/* 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,
- .targetsize = ARPT_FUNCTION_MAXNAMELEN,
- .family = NF_ARP,
};
static struct nf_sockopt_ops arpt_sockopts = {
.get = do_arpt_get_ctl,
};
-static int __init arp_tables_init(void)
+static int __init init(void)
{
int ret;
xt_proto_init(NF_ARP);
/* Noone else will be downing sem now, so we won't sleep */
- xt_register_target(&arpt_standard_target);
- xt_register_target(&arpt_error_target);
+ xt_register_target(NF_ARP, &arpt_standard_target);
+ xt_register_target(NF_ARP, &arpt_error_target);
/* Register setsockopt */
ret = nf_register_sockopt(&arpt_sockopts);
return 0;
}
-static void __exit arp_tables_fini(void)
+static void __exit fini(void)
{
nf_unregister_sockopt(&arpt_sockopts);
xt_proto_fini(NF_ARP);
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);