]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/netfilter/nfnetlink_log.c
[NETFILTER]: nf_log: constify struct nf_logger and nf_log_packet loginfo arg
[mv-sheeva.git] / net / netfilter / nfnetlink_log.c
index 2135926199ca39387effe3864f3aa3461bded3cc..02e63577e156a600a81fec20ad1f5ae42b4b7b59 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/jhash.h>
 #include <linux/random.h>
 #include <net/sock.h>
+#include <net/netfilter/nf_log.h>
 
 #include <asm/atomic.h>
 
@@ -725,7 +726,7 @@ nfulnl_recv_unsupp(struct sock *ctnl, struct sk_buff *skb,
        return -ENOTSUPP;
 }
 
-static struct nf_logger nfulnl_logger = {
+static const struct nf_logger nfulnl_logger = {
        .name   = "nfnetlink_log",
        .logfn  = &nfulnl_log_packet,
        .me     = THIS_MODULE,
@@ -951,22 +952,8 @@ static const struct seq_operations nful_seq_ops = {
 
 static int nful_open(struct inode *inode, struct file *file)
 {
-       struct seq_file *seq;
-       struct iter_state *is;
-       int ret;
-
-       is = kzalloc(sizeof(*is), GFP_KERNEL);
-       if (!is)
-               return -ENOMEM;
-       ret = seq_open(file, &nful_seq_ops);
-       if (ret < 0)
-               goto out_free;
-       seq = file->private_data;
-       seq->private = is;
-       return ret;
-out_free:
-       kfree(is);
-       return ret;
+       return seq_open_private(file, &nful_seq_ops,
+                       sizeof(struct iter_state));
 }
 
 static const struct file_operations nful_file_ops = {