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
/
iptable_filter.c
diff --git
a/net/ipv4/netfilter/iptable_filter.c
b/net/ipv4/netfilter/iptable_filter.c
index
7f41748
..
212a307
100644
(file)
--- a/
net/ipv4/netfilter/iptable_filter.c
+++ b/
net/ipv4/netfilter/iptable_filter.c
@@
-139,7
+139,7
@@
static struct nf_hook_ops ipt_ops[] = {
static int forward = NF_ACCEPT;
module_param(forward, bool, 0000);
static int forward = NF_ACCEPT;
module_param(forward, bool, 0000);
-static int __init i
ptable_filter_i
nit(void)
+static int __init init(void)
{
int ret;
{
int ret;
@@
-157,22
+157,39
@@
static int __init iptable_filter_init(void)
return ret;
/* Register hooks */
return ret;
/* Register hooks */
- ret = nf_register_hook
s(ipt_ops, ARRAY_SIZE(ipt_ops)
);
+ ret = nf_register_hook
(&ipt_ops[0]
);
if (ret < 0)
goto cleanup_table;
if (ret < 0)
goto cleanup_table;
+ ret = nf_register_hook(&ipt_ops[1]);
+ if (ret < 0)
+ goto cleanup_hook0;
+
+ ret = nf_register_hook(&ipt_ops[2]);
+ if (ret < 0)
+ goto cleanup_hook1;
+
return ret;
return ret;
+ cleanup_hook1:
+ nf_unregister_hook(&ipt_ops[1]);
+ cleanup_hook0:
+ nf_unregister_hook(&ipt_ops[0]);
cleanup_table:
ipt_unregister_table(&packet_filter);
cleanup_table:
ipt_unregister_table(&packet_filter);
+
return ret;
}
return ret;
}
-static void __exit
iptable_filter_
fini(void)
+static void __exit fini(void)
{
{
- nf_unregister_hooks(ipt_ops, ARRAY_SIZE(ipt_ops));
+ unsigned int i;
+
+ for (i = 0; i < sizeof(ipt_ops)/sizeof(struct nf_hook_ops); i++)
+ nf_unregister_hook(&ipt_ops[i]);
+
ipt_unregister_table(&packet_filter);
}
ipt_unregister_table(&packet_filter);
}
-module_init(i
ptable_filter_i
nit);
-module_exit(
iptable_filter_
fini);
+module_init(init);
+module_exit(fini);