netfilter: xtables: untangle spaghetti if clauses in checkentry
[deliverable/linux.git] / net / netfilter / xt_limit.c
index 2773be6a71ddf49a2d8297a3183274472a0a7d61..b3dfca63fa52928669f94c5ae910b30df5fc8033 100644 (file)
@@ -5,7 +5,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/skbuff.h>
 #include <linux/spinlock.h>
@@ -105,8 +105,8 @@ static bool limit_mt_check(const struct xt_mtchk_param *par)
        /* Check for overflow. */
        if (r->burst == 0
            || user2credits(r->avg * r->burst) < user2credits(r->avg)) {
-               printk("Overflow in xt_limit, try lower: %u/%u\n",
-                      r->avg, r->burst);
+               pr_info("Overflow, try lower: %u/%u\n",
+                       r->avg, r->burst);
                return false;
        }
 
@@ -148,7 +148,7 @@ struct compat_xt_rateinfo {
 
 /* To keep the full "prev" timestamp, the upper 32 bits are stored in the
  * master pointer, which does not need to be preserved. */
-static void limit_mt_compat_from_user(void *dst, void *src)
+static void limit_mt_compat_from_user(void *dst, const void *src)
 {
        const struct compat_xt_rateinfo *cm = src;
        struct xt_rateinfo m = {
@@ -162,7 +162,7 @@ static void limit_mt_compat_from_user(void *dst, void *src)
        memcpy(dst, &m, sizeof(m));
 }
 
-static int limit_mt_compat_to_user(void __user *dst, void *src)
+static int limit_mt_compat_to_user(void __user *dst, const void *src)
 {
        const struct xt_rateinfo *m = src;
        struct compat_xt_rateinfo cm = {
This page took 0.024893 seconds and 5 git commands to generate.