]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/netfilter/nf_conntrack_expect.c
[NETFILTER]: nfnetlink: support attribute policies
[mv-sheeva.git] / net / netfilter / nf_conntrack_expect.c
index eb6695dcd73b6b5f51ff843b14eb55a379cc1de8..8a3e3af656bf721daadb01f0a8b1352c48365cac 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/percpu.h>
 #include <linux/kernel.h>
 #include <linux/jhash.h>
+#include <net/net_namespace.h>
 
 #include <net/netfilter/nf_conntrack.h>
 #include <net/netfilter/nf_conntrack_core.h>
@@ -477,15 +478,14 @@ static int exp_open(struct inode *inode, struct file *file)
        struct ct_expect_iter_state *st;
        int ret;
 
-       st = kmalloc(sizeof(struct ct_expect_iter_state), GFP_KERNEL);
-       if (st == NULL)
+       st = kzalloc(sizeof(struct ct_expect_iter_state), GFP_KERNEL);
+       if (!st)
                return -ENOMEM;
        ret = seq_open(file, &exp_seq_ops);
        if (ret)
                goto out_free;
        seq          = file->private_data;
        seq->private = st;
-       memset(st, 0, sizeof(struct ct_expect_iter_state));
        return ret;
 out_free:
        kfree(st);
@@ -506,7 +506,7 @@ static int __init exp_proc_init(void)
 #ifdef CONFIG_PROC_FS
        struct proc_dir_entry *proc;
 
-       proc = proc_net_fops_create("nf_conntrack_expect", 0440, &exp_file_ops);
+       proc = proc_net_fops_create(&init_net, "nf_conntrack_expect", 0440, &exp_file_ops);
        if (!proc)
                return -ENOMEM;
 #endif /* CONFIG_PROC_FS */
@@ -516,7 +516,7 @@ static int __init exp_proc_init(void)
 static void exp_proc_remove(void)
 {
 #ifdef CONFIG_PROC_FS
-       proc_net_remove("nf_conntrack_expect");
+       proc_net_remove(&init_net, "nf_conntrack_expect");
 #endif /* CONFIG_PROC_FS */
 }