]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/netfilter/xt_esp.c
netfilter: xt extensions: use pr_<level> (2)
[net-next-2.6.git] / net / netfilter / xt_esp.c
index 609439967c2c67579d299e9e43218a7c362da8a8..1a446d626769b3521cdc9618073e095e6c5c3369 100644 (file)
@@ -6,7 +6,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/in.h>
@@ -24,21 +24,15 @@ MODULE_DESCRIPTION("Xtables: IPsec-ESP packet match");
 MODULE_ALIAS("ipt_esp");
 MODULE_ALIAS("ip6t_esp");
 
-#if 0
-#define duprintf(format, args...) printk(format , ## args)
-#else
-#define duprintf(format, args...)
-#endif
-
 /* Returns 1 if the spi is matched by the range, 0 otherwise */
 static inline bool
 spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)
 {
        bool r;
-       duprintf("esp spi_match:%c 0x%x <= 0x%x <= 0x%x", invert ? '!' : ' ',
-                min, spi, max);
+       pr_debug("spi_match:%c 0x%x <= 0x%x <= 0x%x\n",
+                invert ? '!' : ' ', min, spi, max);
        r = (spi >= min && spi <= max) ^ invert;
-       duprintf(" result %s\n", r ? "PASS" : "FAILED");
+       pr_debug(" result %s\n", r ? "PASS" : "FAILED");
        return r;
 }
 
@@ -57,7 +51,7 @@ static bool esp_mt(const struct sk_buff *skb, const struct xt_match_param *par)
                /* We've been asked to examine this packet, and we
                 * can't.  Hence, no choice but to drop.
                 */
-               duprintf("Dropping evil ESP tinygram.\n");
+               pr_debug("Dropping evil ESP tinygram.\n");
                *par->hotdrop = true;
                return false;
        }
@@ -71,7 +65,7 @@ static bool esp_mt_check(const struct xt_mtchk_param *par)
        const struct xt_esp *espinfo = par->matchinfo;
 
        if (espinfo->invflags & ~XT_ESP_INV_MASK) {
-               duprintf("xt_esp: unknown flags %X\n", espinfo->invflags);
+               pr_debug("unknown flags %X\n", espinfo->invflags);
                return false;
        }