netfilter: xt extensions: use pr_<level>
authorJan Engelhardt <jengelh@medozas.de>
Wed, 17 Mar 2010 15:04:40 +0000 (16:04 +0100)
committerJan Engelhardt <jengelh@medozas.de>
Thu, 18 Mar 2010 13:20:07 +0000 (14:20 +0100)
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
21 files changed:
net/netfilter/xt_CONNSECMARK.c
net/netfilter/xt_DSCP.c
net/netfilter/xt_HL.c
net/netfilter/xt_LED.c
net/netfilter/xt_SECMARK.c
net/netfilter/xt_TCPMSS.c
net/netfilter/xt_cluster.c
net/netfilter/xt_connbytes.c
net/netfilter/xt_connlimit.c
net/netfilter/xt_connmark.c
net/netfilter/xt_conntrack.c
net/netfilter/xt_dscp.c
net/netfilter/xt_hashlimit.c
net/netfilter/xt_helper.c
net/netfilter/xt_hl.c
net/netfilter/xt_limit.c
net/netfilter/xt_osf.c
net/netfilter/xt_physdev.c
net/netfilter/xt_policy.c
net/netfilter/xt_recent.c
net/netfilter/xt_state.c

index b54c3756fdc3b942be616d6905b2ca62cb4cc0b4..6812865488d6ed4d87b836274ec5dfe94d9906ca 100644 (file)
@@ -15,6 +15,7 @@
  * published by the Free Software Foundation.
  *
  */
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 #include <linux/module.h>
 #include <linux/skbuff.h>
 #include <linux/netfilter/x_tables.h>
@@ -22,8 +23,6 @@
 #include <net/netfilter/nf_conntrack.h>
 #include <net/netfilter/nf_conntrack_ecache.h>
 
-#define PFX "CONNSECMARK: "
-
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("James Morris <jmorris@redhat.com>");
 MODULE_DESCRIPTION("Xtables: target for copying between connection and security mark");
@@ -91,8 +90,8 @@ static bool connsecmark_tg_check(const struct xt_tgchk_param *par)
 
        if (strcmp(par->table, "mangle") != 0 &&
            strcmp(par->table, "security") != 0) {
-               printk(KERN_INFO PFX "target only valid in the \'mangle\' "
-                      "or \'security\' tables, not \'%s\'.\n", par->table);
+               pr_info("target only valid in the \'mangle\' "
+                       "or \'security\' tables, not \'%s\'.\n", par->table);
                return false;
        }
 
@@ -102,13 +101,13 @@ static bool connsecmark_tg_check(const struct xt_tgchk_param *par)
                break;
 
        default:
-               printk(KERN_INFO PFX "invalid mode: %hu\n", info->mode);
+               pr_info("invalid mode: %hu\n", info->mode);
                return false;
        }
 
        if (nf_ct_l3proto_try_module_get(par->family) < 0) {
-               printk(KERN_WARNING "can't load conntrack support for "
-                                   "proto=%u\n", par->family);
+               pr_info("cannot load conntrack support for proto=%u\n",
+                       par->family);
                return false;
        }
        return true;
index 74ce892600569020fe077b8e0de83f948d981dc9..bbf08a91c600045490f03c9e5c214cc3138f4498 100644 (file)
@@ -9,7 +9,7 @@
  *
  * See RFC2474 for a description of the DSCP field within the IP Header.
 */
-
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 #include <linux/module.h>
 #include <linux/skbuff.h>
 #include <linux/ip.h>
@@ -65,7 +65,7 @@ static bool dscp_tg_check(const struct xt_tgchk_param *par)
        const struct xt_DSCP_info *info = par->targinfo;
 
        if (info->dscp > XT_DSCP_MAX) {
-               printk(KERN_WARNING "DSCP: dscp %x out of range\n", info->dscp);
+               pr_info("dscp %x out of range\n", info->dscp);
                return false;
        }
        return true;
index 10e789e2d12af24d5f526e0feea8c6414d7069bc..7004ed2ffa44cb10f39c3817e2ab7061c3c910e9 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/skbuff.h>
 #include <linux/ip.h>
@@ -106,8 +106,7 @@ static bool ttl_tg_check(const struct xt_tgchk_param *par)
        const struct ipt_TTL_info *info = par->targinfo;
 
        if (info->mode > IPT_TTL_MAXMODE) {
-               printk(KERN_WARNING "ipt_TTL: invalid or unknown Mode %u\n",
-                       info->mode);
+               pr_info("TTL: invalid or unknown mode %u\n", info->mode);
                return false;
        }
        if (info->mode != IPT_TTL_SET && info->ttl == 0)
@@ -120,12 +119,11 @@ static bool hl_tg6_check(const struct xt_tgchk_param *par)
        const struct ip6t_HL_info *info = par->targinfo;
 
        if (info->mode > IP6T_HL_MAXMODE) {
-               printk(KERN_WARNING "ip6t_HL: invalid or unknown Mode %u\n",
-                       info->mode);
+               pr_info("invalid or unknown mode %u\n", info->mode);
                return false;
        }
        if (info->mode != IP6T_HL_SET && info->hop_limit == 0) {
-               printk(KERN_WARNING "ip6t_HL: increment/decrement doesn't "
+               pr_info("increment/decrement does not "
                        "make sense with value 0\n");
                return false;
        }
index 0d6c2885ebd6797f42a35e72f618cc9c6bcd9c95..f511bea9464a2f2b1e5a094906cae38111017599 100644 (file)
@@ -18,7 +18,7 @@
  * 02110-1301 USA.
  *
  */
-
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 #include <linux/module.h>
 #include <linux/skbuff.h>
 #include <linux/netfilter/x_tables.h>
@@ -87,7 +87,7 @@ static bool led_tg_check(const struct xt_tgchk_param *par)
        int err;
 
        if (ledinfo->id[0] == '\0') {
-               printk(KERN_ERR KBUILD_MODNAME ": No 'id' parameter given.\n");
+               pr_info("No 'id' parameter given.\n");
                return false;
        }
 
@@ -99,11 +99,9 @@ static bool led_tg_check(const struct xt_tgchk_param *par)
 
        err = led_trigger_register(&ledinternal->netfilter_led_trigger);
        if (err) {
-               printk(KERN_CRIT KBUILD_MODNAME
-                       ": led_trigger_register() failed\n");
+               pr_warning("led_trigger_register() failed\n");
                if (err == -EEXIST)
-                       printk(KERN_ERR KBUILD_MODNAME
-                               ": Trigger name is already in use.\n");
+                       pr_warning("Trigger name is already in use.\n");
                goto exit_alloc;
        }
 
index 7a6f9e6f5dfaa6b7e4e5eb57890542a99065b0e3..4855fd9d7c6f787390a1f195b7b8daa0b6b7a22a 100644 (file)
@@ -12,6 +12,7 @@
  * published by the Free Software Foundation.
  *
  */
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 #include <linux/module.h>
 #include <linux/skbuff.h>
 #include <linux/selinux.h>
@@ -59,20 +60,19 @@ static bool checkentry_selinux(struct xt_secmark_target_info *info)
        err = selinux_string_to_sid(sel->selctx, &sel->selsid);
        if (err) {
                if (err == -EINVAL)
-                       printk(KERN_INFO PFX "invalid SELinux context \'%s\'\n",
-                              sel->selctx);
+                       pr_info("invalid SELinux context \'%s\'\n",
+                               sel->selctx);
                return false;
        }
 
        if (!sel->selsid) {
-               printk(KERN_INFO PFX "unable to map SELinux context \'%s\'\n",
-                      sel->selctx);
+               pr_info("unable to map SELinux context \'%s\'\n", sel->selctx);
                return false;
        }
 
        err = selinux_secmark_relabel_packet_permission(sel->selsid);
        if (err) {
-               printk(KERN_INFO PFX "unable to obtain relabeling permission\n");
+               pr_info("unable to obtain relabeling permission\n");
                return false;
        }
 
@@ -86,14 +86,14 @@ static bool secmark_tg_check(const struct xt_tgchk_param *par)
 
        if (strcmp(par->table, "mangle") != 0 &&
            strcmp(par->table, "security") != 0) {
-               printk(KERN_INFO PFX "target only valid in the \'mangle\' "
-                      "or \'security\' tables, not \'%s\'.\n", par->table);
+               pr_info("target only valid in the \'mangle\' "
+                       "or \'security\' tables, not \'%s\'.\n", par->table);
                return false;
        }
 
        if (mode && mode != info->mode) {
-               printk(KERN_INFO PFX "mode already set to %hu cannot mix with "
-                      "rules for mode %hu\n", mode, info->mode);
+               pr_info("mode already set to %hu cannot mix with "
+                       "rules for mode %hu\n", mode, info->mode);
                return false;
        }
 
@@ -104,7 +104,7 @@ static bool secmark_tg_check(const struct xt_tgchk_param *par)
                break;
 
        default:
-               printk(KERN_INFO PFX "invalid mode: %hu\n", info->mode);
+               pr_info("invalid mode: %hu\n", info->mode);
                return false;
        }
 
index 0e357ac9a2a831b85fee911847b4c2427d8255d6..2077da31c9737b1378ec8b321433ee4616fcee6a 100644 (file)
@@ -7,7 +7,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/ip.h>
@@ -67,14 +67,14 @@ tcpmss_mangle_packet(struct sk_buff *skb,
        if (info->mss == XT_TCPMSS_CLAMP_PMTU) {
                if (dst_mtu(skb_dst(skb)) <= minlen) {
                        if (net_ratelimit())
-                               printk(KERN_ERR "xt_TCPMSS: "
+                               pr_err("xt_TCPMSS: "
                                       "unknown or invalid path-MTU (%u)\n",
                                       dst_mtu(skb_dst(skb)));
                        return -1;
                }
                if (in_mtu <= minlen) {
                        if (net_ratelimit())
-                               printk(KERN_ERR "xt_TCPMSS: unknown or "
+                               pr_err("xt_TCPMSS: unknown or "
                                       "invalid path-MTU (%u)\n", in_mtu);
                        return -1;
                }
@@ -245,14 +245,14 @@ static bool tcpmss_tg4_check(const struct xt_tgchk_param *par)
            (par->hook_mask & ~((1 << NF_INET_FORWARD) |
                           (1 << NF_INET_LOCAL_OUT) |
                           (1 << NF_INET_POST_ROUTING))) != 0) {
-               printk("xt_TCPMSS: path-MTU clamping only supported in "
-                      "FORWARD, OUTPUT and POSTROUTING hooks\n");
+               pr_info("path-MTU clamping only supported in "
+                       "FORWARD, OUTPUT and POSTROUTING hooks\n");
                return false;
        }
        xt_ematch_foreach(ematch, e)
                if (find_syn_match(ematch))
                        return true;
-       printk("xt_TCPMSS: Only works on TCP SYN packets\n");
+       pr_info("Only works on TCP SYN packets\n");
        return false;
 }
 
@@ -267,14 +267,14 @@ static bool tcpmss_tg6_check(const struct xt_tgchk_param *par)
            (par->hook_mask & ~((1 << NF_INET_FORWARD) |
                           (1 << NF_INET_LOCAL_OUT) |
                           (1 << NF_INET_POST_ROUTING))) != 0) {
-               printk("xt_TCPMSS: path-MTU clamping only supported in "
-                      "FORWARD, OUTPUT and POSTROUTING hooks\n");
+               pr_info("path-MTU clamping only supported in "
+                       "FORWARD, OUTPUT and POSTROUTING hooks\n");
                return false;
        }
        xt_ematch_foreach(ematch, e)
                if (find_syn_match(ematch))
                        return true;
-       printk("xt_TCPMSS: Only works on TCP SYN packets\n");
+       pr_info("Only works on TCP SYN packets\n");
        return false;
 }
 #endif
index 225ee3ecd69d63152489a0f47ae76d5cbacb7b8f..4c273e871301975f4435b152dd53dfcd05f47929 100644 (file)
@@ -5,6 +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/jhash.h>
@@ -136,14 +137,14 @@ static bool xt_cluster_mt_checkentry(const struct xt_mtchk_param *par)
        struct xt_cluster_match_info *info = par->matchinfo;
 
        if (info->total_nodes > XT_CLUSTER_NODES_MAX) {
-               printk(KERN_ERR "xt_cluster: you have exceeded the maximum "
-                               "number of cluster nodes (%u > %u)\n",
-                               info->total_nodes, XT_CLUSTER_NODES_MAX);
+               pr_info("you have exceeded the maximum "
+                       "number of cluster nodes (%u > %u)\n",
+                       info->total_nodes, XT_CLUSTER_NODES_MAX);
                return false;
        }
        if (info->node_mask >= (1ULL << info->total_nodes)) {
-               printk(KERN_ERR "xt_cluster: this node mask cannot be "
-                               "higher than the total number of nodes\n");
+               pr_info("this node mask cannot be "
+                       "higher than the total number of nodes\n");
                return false;
        }
        return true;
index 955e6598a7f0a9fc02d4ed2f52425178a1706cb2..edb7bbd9ae54c76071206f6594b6daa3bf1c6b06 100644 (file)
@@ -1,6 +1,7 @@
 /* Kernel module to match connection tracking byte counter.
  * GPL (C) 2002 Martin Devera (devik@cdi.cz).
  */
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 #include <linux/module.h>
 #include <linux/bitops.h>
 #include <linux/skbuff.h>
@@ -107,8 +108,8 @@ static bool connbytes_mt_check(const struct xt_mtchk_param *par)
                return false;
 
        if (nf_ct_l3proto_try_module_get(par->family) < 0) {
-               printk(KERN_WARNING "can't load conntrack support for "
-                                   "proto=%u\n", par->family);
+               pr_info("cannot load conntrack support for proto=%u\n",
+                       par->family);
                return false;
        }
 
index 9e624af40f801022ec6d953596c9833d5b4369a4..d5b26dab9e26de074a99cd75c7ab5bd53674244b 100644 (file)
@@ -11,6 +11,7 @@
  * Kernel module to match connection tracking information.
  * GPL (C) 1999  Rusty Russell (rusty@rustcorp.com.au).
  */
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 #include <linux/in.h>
 #include <linux/in6.h>
 #include <linux/ip.h>
@@ -225,8 +226,8 @@ static bool connlimit_mt_check(const struct xt_mtchk_param *par)
                connlimit_rnd_inited = true;
        }
        if (nf_ct_l3proto_try_module_get(par->family) < 0) {
-               printk(KERN_WARNING "cannot load conntrack support for "
-                      "address family %u\n", par->family);
+               pr_info("cannot load conntrack support for "
+                       "address family %u\n", par->family);
                return false;
        }
 
index 97465a4723440ba25536d31fd0d3c74f6c2f9846..7a51ba63f54568e5af17596e2e7b1c1ba3342a2e 100644 (file)
@@ -77,8 +77,8 @@ connmark_tg(struct sk_buff *skb, const struct xt_target_param *par)
 static bool connmark_tg_check(const struct xt_tgchk_param *par)
 {
        if (nf_ct_l3proto_try_module_get(par->family) < 0) {
-               printk(KERN_WARNING "cannot load conntrack support for "
-                      "proto=%u\n", par->family);
+               pr_info("cannot load conntrack support for proto=%u\n",
+                       par->family);
                return false;
        }
        return true;
@@ -106,8 +106,8 @@ connmark_mt(const struct sk_buff *skb, const struct xt_match_param *par)
 static bool connmark_mt_check(const struct xt_mtchk_param *par)
 {
        if (nf_ct_l3proto_try_module_get(par->family) < 0) {
-               printk(KERN_WARNING "cannot load conntrack support for "
-                      "proto=%u\n", par->family);
+               pr_info("cannot load conntrack support for proto=%u\n",
+                       par->family);
                return false;
        }
        return true;
index ae66305f0fe5c088861fedb6c08d16af4c2438cd..387172b6b0d8385d82fc253ee00362e2dc52d474 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/skbuff.h>
 #include <net/ipv6.h>
@@ -209,8 +209,8 @@ conntrack_mt_v2(const struct sk_buff *skb, const struct xt_match_param *par)
 static bool conntrack_mt_check(const struct xt_mtchk_param *par)
 {
        if (nf_ct_l3proto_try_module_get(par->family) < 0) {
-               printk(KERN_WARNING "can't load conntrack support for "
-                                   "proto=%u\n", par->family);
+               pr_info("cannot load conntrack support for proto=%u\n",
+                       par->family);
                return false;
        }
        return true;
index fe58cd01ef99804cf02cfc7ffc3bf69bfcccbe72..6ecedc13db0c92ac465c0f1620c27dd02bbb8e2a 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/ip.h>
@@ -47,7 +47,7 @@ static bool dscp_mt_check(const struct xt_mtchk_param *par)
        const struct xt_dscp_info *info = par->matchinfo;
 
        if (info->dscp > XT_DSCP_MAX) {
-               printk(KERN_ERR "xt_dscp: dscp %x out of range\n", info->dscp);
+               pr_info("dscp %x out of range\n", info->dscp);
                return false;
        }
 
index 52327c5c1f1d17b6440809bf6bd5714c4db2dd31..8f3e0c02ca548f70b68050ad9a60753174a55d76 100644 (file)
@@ -7,6 +7,7 @@
  *
  * Development of this code was funded by Astaro AG, http://www.astaro.com/
  */
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/random.h>
@@ -166,17 +167,14 @@ dsthash_alloc_init(struct xt_hashlimit_htable *ht,
        if (ht->cfg.max && ht->count >= ht->cfg.max) {
                /* FIXME: do something. question is what.. */
                if (net_ratelimit())
-                       printk(KERN_WARNING
-                               "xt_hashlimit: max count of %u reached\n",
-                               ht->cfg.max);
+                       pr_err("max count of %u reached\n", ht->cfg.max);
                return NULL;
        }
 
        ent = kmem_cache_alloc(hashlimit_cachep, GFP_ATOMIC);
        if (!ent) {
                if (net_ratelimit())
-                       printk(KERN_ERR
-                               "xt_hashlimit: can't allocate dsthash_ent\n");
+                       pr_err("cannot allocate dsthash_ent\n");
                return NULL;
        }
        memcpy(&ent->dst, dst, sizeof(ent->dst));
@@ -681,8 +679,8 @@ static bool hashlimit_mt_check_v0(const struct xt_mtchk_param *par)
        /* Check for overflow. */
        if (r->cfg.burst == 0 ||
            user2credits(r->cfg.avg * r->cfg.burst) < user2credits(r->cfg.avg)) {
-               printk(KERN_ERR "xt_hashlimit: overflow, try lower: %u/%u\n",
-                      r->cfg.avg, r->cfg.burst);
+               pr_info("overflow, try lower: %u/%u\n",
+                       r->cfg.avg, r->cfg.burst);
                return false;
        }
        if (r->cfg.mode == 0 ||
@@ -718,8 +716,8 @@ static bool hashlimit_mt_check(const struct xt_mtchk_param *par)
        if (info->cfg.burst == 0 ||
            user2credits(info->cfg.avg * info->cfg.burst) <
            user2credits(info->cfg.avg)) {
-               printk(KERN_ERR "xt_hashlimit: overflow, try lower: %u/%u\n",
-                      info->cfg.avg, info->cfg.burst);
+               pr_info("overflow, try lower: %u/%u\n",
+                       info->cfg.avg, info->cfg.burst);
                return false;
        }
        if (info->cfg.gc_interval == 0 || info->cfg.expire == 0)
@@ -1018,7 +1016,7 @@ static int __init hashlimit_mt_init(void)
                                            sizeof(struct dsthash_ent), 0, 0,
                                            NULL);
        if (!hashlimit_cachep) {
-               printk(KERN_ERR "xt_hashlimit: unable to create slab cache\n");
+               pr_warning("unable to create slab cache\n");
                goto err2;
        }
        return 0;
index 64fc7f277221b67c9e77ac0dd2addc2004192863..482aff2ccf7c0501390f8b1ef51512272110baa3 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/netfilter.h>
@@ -59,8 +59,8 @@ static bool helper_mt_check(const struct xt_mtchk_param *par)
        struct xt_helper_info *info = par->matchinfo;
 
        if (nf_ct_l3proto_try_module_get(par->family) < 0) {
-               printk(KERN_WARNING "can't load conntrack support for "
-                                   "proto=%u\n", par->family);
+               pr_info("cannot load conntrack support for proto=%u\n",
+                       par->family);
                return false;
        }
        info->name[29] = '\0';
index 7726154c87b25c919a1ff5a870d5659649c6bcf6..be53f729962316a8a871e6ca5512f29f8eb85e67 100644 (file)
@@ -39,10 +39,6 @@ static bool ttl_mt(const struct sk_buff *skb, const struct xt_match_param *par)
                        return ttl < info->ttl;
                case IPT_TTL_GT:
                        return ttl > info->ttl;
-               default:
-                       printk(KERN_WARNING "ipt_ttl: unknown mode %d\n",
-                               info->mode);
-                       return false;
        }
 
        return false;
@@ -56,20 +52,12 @@ static bool hl_mt6(const struct sk_buff *skb, const struct xt_match_param *par)
        switch (info->mode) {
                case IP6T_HL_EQ:
                        return ip6h->hop_limit == info->hop_limit;
-                       break;
                case IP6T_HL_NE:
                        return ip6h->hop_limit != info->hop_limit;
-                       break;
                case IP6T_HL_LT:
                        return ip6h->hop_limit < info->hop_limit;
-                       break;
                case IP6T_HL_GT:
                        return ip6h->hop_limit > info->hop_limit;
-                       break;
-               default:
-                       printk(KERN_WARNING "ip6t_hl: unknown mode %d\n",
-                               info->mode);
-                       return false;
        }
 
        return false;
index a0ca5339af41523a174f117a7307e46833711c42..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;
        }
 
index 4169e200588dc6c0dbc112826d2a4484cfd22065..8dcde13a0781439b7458fdc8a3c7eb07146f9054 100644 (file)
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
-
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 #include <linux/module.h>
 #include <linux/kernel.h>
 
@@ -382,14 +382,14 @@ static int __init xt_osf_init(void)
 
        err = nfnetlink_subsys_register(&xt_osf_nfnetlink);
        if (err < 0) {
-               printk(KERN_ERR "Failed (%d) to register OSF nsfnetlink helper.\n", err);
+               pr_err("Failed to register OSF nsfnetlink helper (%d)\n", err);
                goto err_out_exit;
        }
 
        err = xt_register_match(&xt_osf_match);
        if (err) {
-               printk(KERN_ERR "Failed (%d) to register OS fingerprint "
-                               "matching module.\n", err);
+               pr_err("Failed to register OS fingerprint "
+                      "matching module (%d)\n", err);
                goto err_out_remove;
        }
 
index 8d28ca5848bc6a57d6363023683d8c3d6daaddc3..3d42a278408f7bdc80a5a27d48ee3c1ed0e11c89 100644 (file)
@@ -7,7 +7,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/netfilter_bridge.h>
@@ -95,9 +95,9 @@ static bool physdev_mt_check(const struct xt_mtchk_param *par)
             info->invert & XT_PHYSDEV_OP_BRIDGED) &&
            par->hook_mask & ((1 << NF_INET_LOCAL_OUT) |
            (1 << NF_INET_FORWARD) | (1 << NF_INET_POST_ROUTING))) {
-               printk(KERN_WARNING "physdev match: using --physdev-out in the "
-                      "OUTPUT, FORWARD and POSTROUTING chains for non-bridged "
-                      "traffic is not supported anymore.\n");
+               pr_info("using --physdev-out in the OUTPUT, FORWARD and "
+                       "POSTROUTING chains for non-bridged traffic is not "
+                       "supported anymore.\n");
                if (par->hook_mask & (1 << NF_INET_LOCAL_OUT))
                        return false;
        }
index cc033d2c35ea651523dcc799caa218678cfd1dbf..de3aded6afb842b1f74c4614515e6f87b4edef9c 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/kernel.h>
 #include <linux/module.h>
 #include <linux/skbuff.h>
@@ -133,24 +133,21 @@ static bool policy_mt_check(const struct xt_mtchk_param *par)
        const struct xt_policy_info *info = par->matchinfo;
 
        if (!(info->flags & (XT_POLICY_MATCH_IN|XT_POLICY_MATCH_OUT))) {
-               printk(KERN_ERR "xt_policy: neither incoming nor "
-                               "outgoing policy selected\n");
+               pr_info("neither incoming nor outgoing policy selected\n");
                return false;
        }
        if (par->hook_mask & ((1 << NF_INET_PRE_ROUTING) |
            (1 << NF_INET_LOCAL_IN)) && info->flags & XT_POLICY_MATCH_OUT) {
-               printk(KERN_ERR "xt_policy: output policy not valid in "
-                               "PRE_ROUTING and INPUT\n");
+               pr_info("output policy not valid in PREROUTING and INPUT\n");
                return false;
        }
        if (par->hook_mask & ((1 << NF_INET_POST_ROUTING) |
            (1 << NF_INET_LOCAL_OUT)) && info->flags & XT_POLICY_MATCH_IN) {
-               printk(KERN_ERR "xt_policy: input policy not valid in "
-                               "POST_ROUTING and OUTPUT\n");
+               pr_info("input policy not valid in POSTROUTING and OUTPUT\n");
                return false;
        }
        if (info->len > XT_POLICY_MAX_ELEM) {
-               printk(KERN_ERR "xt_policy: too many policy elements\n");
+               pr_info("too many policy elements\n");
                return false;
        }
        return true;
index a0ea1a21c470800ea6312a7ca3499bce91eb87e7..aa9817e91338e15f61d3a6c1396fe7fb3e748c99 100644 (file)
@@ -12,6 +12,7 @@
  * Author: Stephen Frost <sfrost@snowman.net>
  * Copyright 2002-2003, Stephen Frost, 2.5.x port by laforge@netfilter.org
  */
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 #include <linux/init.h>
 #include <linux/ip.h>
 #include <linux/ipv6.h>
@@ -520,7 +521,7 @@ recent_mt_proc_write(struct file *file, const char __user *input,
                add = true;
                break;
        default:
-               printk(KERN_INFO KBUILD_MODNAME ": Need +ip, -ip or /\n");
+               pr_info("Need \"+ip\", \"-ip\" or \"/\"\n");
                return -EINVAL;
        }
 
@@ -535,8 +536,7 @@ recent_mt_proc_write(struct file *file, const char __user *input,
        }
 
        if (!succ) {
-               printk(KERN_INFO KBUILD_MODNAME ": illegal address written "
-                      "to procfs\n");
+               pr_info("illegal address written to procfs\n");
                return -EINVAL;
        }
 
index ef09b2e2970f3d7a19123ae15f98f3922dc262b9..94893be802768e49675f68107741cfe6f6c002ad 100644 (file)
@@ -40,8 +40,8 @@ state_mt(const struct sk_buff *skb, const struct xt_match_param *par)
 static bool state_mt_check(const struct xt_mtchk_param *par)
 {
        if (nf_ct_l3proto_try_module_get(par->family) < 0) {
-               printk(KERN_WARNING "can't load conntrack support for "
-                                   "proto=%u\n", par->family);
+               pr_info("cannot load conntrack support for proto=%u\n",
+                       par->family);
                return false;
        }
        return true;