netfilter: xtables: change targets to return error code
[deliverable/linux.git] / net / ipv4 / netfilter / ipt_LOG.c
index ee128efa1c8d73bbc9b0244d1b44ff2693e5a4f4..a6a454b25502e72398cb83d5c9760747ae4c585e 100644 (file)
@@ -9,7 +9,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/skbuff.h>
@@ -439,20 +439,19 @@ log_tg(struct sk_buff *skb, const struct xt_target_param *par)
        return XT_CONTINUE;
 }
 
-static bool log_tg_check(const struct xt_tgchk_param *par)
+static int log_tg_check(const struct xt_tgchk_param *par)
 {
        const struct ipt_log_info *loginfo = par->targinfo;
 
        if (loginfo->level >= 8) {
-               pr_debug("LOG: level %u >= 8\n", loginfo->level);
-               return false;
+               pr_debug("level %u >= 8\n", loginfo->level);
+               return -EINVAL;
        }
        if (loginfo->prefix[sizeof(loginfo->prefix)-1] != '\0') {
-               pr_debug("LOG: prefix term %i\n",
-                        loginfo->prefix[sizeof(loginfo->prefix)-1]);
-               return false;
+               pr_debug("prefix is not null-terminated\n");
+               return -EINVAL;
        }
-       return true;
+       return 0;
 }
 
 static struct xt_target log_tg_reg __read_mostly = {
This page took 0.027502 seconds and 5 git commands to generate.