linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / net / ipv6 / netfilter / ip6t_LOG.c
index 73c6300..6b930ef 100644 (file)
@@ -426,7 +426,6 @@ ip6t_log_target(struct sk_buff **pskb,
                const struct net_device *in,
                const struct net_device *out,
                unsigned int hooknum,
-               const struct xt_target *target,
                const void *targinfo,
                void *userinfo)
 {
@@ -439,7 +438,7 @@ ip6t_log_target(struct sk_buff **pskb,
 
        if (loginfo->logflags & IP6T_LOG_NFLOG)
                nf_log_packet(PF_INET6, hooknum, *pskb, in, out, &li,
-                             "%s", loginfo->prefix);
+                             loginfo->prefix);
        else
                ip6t_log_packet(PF_INET6, hooknum, *pskb, in, out, &li,
                                loginfo->prefix);
@@ -450,29 +449,35 @@ ip6t_log_target(struct sk_buff **pskb,
 
 static int ip6t_log_checkentry(const char *tablename,
                               const void *entry,
-                              const struct xt_target *target,
                               void *targinfo,
                               unsigned int targinfosize,
                               unsigned int hook_mask)
 {
        const struct ip6t_log_info *loginfo = targinfo;
 
+       if (targinfosize != IP6T_ALIGN(sizeof(struct ip6t_log_info))) {
+               DEBUGP("LOG: targinfosize %u != %u\n",
+                      targinfosize, IP6T_ALIGN(sizeof(struct ip6t_log_info)));
+               return 0;
+       }
+
        if (loginfo->level >= 8) {
                DEBUGP("LOG: level %u >= 8\n", loginfo->level);
                return 0;
        }
+
        if (loginfo->prefix[sizeof(loginfo->prefix)-1] != '\0') {
                DEBUGP("LOG: prefix term %i\n",
                       loginfo->prefix[sizeof(loginfo->prefix)-1]);
                return 0;
        }
+
        return 1;
 }
 
 static struct ip6t_target ip6t_log_reg = {
        .name           = "LOG",
        .target         = ip6t_log_target, 
-       .targetsize     = sizeof(struct ip6t_log_info),
        .checkentry     = ip6t_log_checkentry, 
        .me             = THIS_MODULE,
 };
@@ -483,7 +488,7 @@ static struct nf_logger ip6t_logger = {
        .me             = THIS_MODULE,
 };
 
-static int __init ip6t_log_init(void)
+static int __init init(void)
 {
        if (ip6t_register_target(&ip6t_log_reg))
                return -EINVAL;
@@ -497,11 +502,11 @@ static int __init ip6t_log_init(void)
        return 0;
 }
 
-static void __exit ip6t_log_fini(void)
+static void __exit fini(void)
 {
        nf_log_unregister_logger(&ip6t_logger);
        ip6t_unregister_target(&ip6t_log_reg);
 }
 
-module_init(ip6t_log_init);
-module_exit(ip6t_log_fini);
+module_init(init);
+module_exit(fini);