aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2010-03-17 11:04:40 -0400
committerJan Engelhardt <jengelh@medozas.de>2010-03-18 09:20:07 -0400
commit8bee4bad03c5b601bd6cea123c31025680587ccc (patch)
treed3eb075492251d8ee16ac1282722b7fa66f9368c
parentbe91fd5e323b46450ca82f6828e933e3791fb2f2 (diff)
netfilter: xt extensions: use pr_<level>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
-rw-r--r--net/netfilter/xt_CONNSECMARK.c13
-rw-r--r--net/netfilter/xt_DSCP.c4
-rw-r--r--net/netfilter/xt_HL.c10
-rw-r--r--net/netfilter/xt_LED.c10
-rw-r--r--net/netfilter/xt_SECMARK.c20
-rw-r--r--net/netfilter/xt_TCPMSS.c18
-rw-r--r--net/netfilter/xt_cluster.c11
-rw-r--r--net/netfilter/xt_connbytes.c5
-rw-r--r--net/netfilter/xt_connlimit.c5
-rw-r--r--net/netfilter/xt_connmark.c8
-rw-r--r--net/netfilter/xt_conntrack.c6
-rw-r--r--net/netfilter/xt_dscp.c4
-rw-r--r--net/netfilter/xt_hashlimit.c18
-rw-r--r--net/netfilter/xt_helper.c6
-rw-r--r--net/netfilter/xt_hl.c12
-rw-r--r--net/netfilter/xt_limit.c6
-rw-r--r--net/netfilter/xt_osf.c8
-rw-r--r--net/netfilter/xt_physdev.c8
-rw-r--r--net/netfilter/xt_policy.c13
-rw-r--r--net/netfilter/xt_recent.c6
-rw-r--r--net/netfilter/xt_state.c4
21 files changed, 88 insertions, 107 deletions
diff --git a/net/netfilter/xt_CONNSECMARK.c b/net/netfilter/xt_CONNSECMARK.c
index b54c3756fdc3..6812865488d6 100644
--- a/net/netfilter/xt_CONNSECMARK.c
+++ b/net/netfilter/xt_CONNSECMARK.c
@@ -15,6 +15,7 @@
15 * published by the Free Software Foundation. 15 * published by the Free Software Foundation.
16 * 16 *
17 */ 17 */
18#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
18#include <linux/module.h> 19#include <linux/module.h>
19#include <linux/skbuff.h> 20#include <linux/skbuff.h>
20#include <linux/netfilter/x_tables.h> 21#include <linux/netfilter/x_tables.h>
@@ -22,8 +23,6 @@
22#include <net/netfilter/nf_conntrack.h> 23#include <net/netfilter/nf_conntrack.h>
23#include <net/netfilter/nf_conntrack_ecache.h> 24#include <net/netfilter/nf_conntrack_ecache.h>
24 25
25#define PFX "CONNSECMARK: "
26
27MODULE_LICENSE("GPL"); 26MODULE_LICENSE("GPL");
28MODULE_AUTHOR("James Morris <jmorris@redhat.com>"); 27MODULE_AUTHOR("James Morris <jmorris@redhat.com>");
29MODULE_DESCRIPTION("Xtables: target for copying between connection and security mark"); 28MODULE_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)
91 90
92 if (strcmp(par->table, "mangle") != 0 && 91 if (strcmp(par->table, "mangle") != 0 &&
93 strcmp(par->table, "security") != 0) { 92 strcmp(par->table, "security") != 0) {
94 printk(KERN_INFO PFX "target only valid in the \'mangle\' " 93 pr_info("target only valid in the \'mangle\' "
95 "or \'security\' tables, not \'%s\'.\n", par->table); 94 "or \'security\' tables, not \'%s\'.\n", par->table);
96 return false; 95 return false;
97 } 96 }
98 97
@@ -102,13 +101,13 @@ static bool connsecmark_tg_check(const struct xt_tgchk_param *par)
102 break; 101 break;
103 102
104 default: 103 default:
105 printk(KERN_INFO PFX "invalid mode: %hu\n", info->mode); 104 pr_info("invalid mode: %hu\n", info->mode);
106 return false; 105 return false;
107 } 106 }
108 107
109 if (nf_ct_l3proto_try_module_get(par->family) < 0) { 108 if (nf_ct_l3proto_try_module_get(par->family) < 0) {
110 printk(KERN_WARNING "can't load conntrack support for " 109 pr_info("cannot load conntrack support for proto=%u\n",
111 "proto=%u\n", par->family); 110 par->family);
112 return false; 111 return false;
113 } 112 }
114 return true; 113 return true;
diff --git a/net/netfilter/xt_DSCP.c b/net/netfilter/xt_DSCP.c
index 74ce89260056..bbf08a91c600 100644
--- a/net/netfilter/xt_DSCP.c
+++ b/net/netfilter/xt_DSCP.c
@@ -9,7 +9,7 @@
9 * 9 *
10 * See RFC2474 for a description of the DSCP field within the IP Header. 10 * See RFC2474 for a description of the DSCP field within the IP Header.
11*/ 11*/
12 12#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/skbuff.h> 14#include <linux/skbuff.h>
15#include <linux/ip.h> 15#include <linux/ip.h>
@@ -65,7 +65,7 @@ static bool dscp_tg_check(const struct xt_tgchk_param *par)
65 const struct xt_DSCP_info *info = par->targinfo; 65 const struct xt_DSCP_info *info = par->targinfo;
66 66
67 if (info->dscp > XT_DSCP_MAX) { 67 if (info->dscp > XT_DSCP_MAX) {
68 printk(KERN_WARNING "DSCP: dscp %x out of range\n", info->dscp); 68 pr_info("dscp %x out of range\n", info->dscp);
69 return false; 69 return false;
70 } 70 }
71 return true; 71 return true;
diff --git a/net/netfilter/xt_HL.c b/net/netfilter/xt_HL.c
index 10e789e2d12a..7004ed2ffa44 100644
--- a/net/netfilter/xt_HL.c
+++ b/net/netfilter/xt_HL.c
@@ -9,7 +9,7 @@
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12 12#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/skbuff.h> 14#include <linux/skbuff.h>
15#include <linux/ip.h> 15#include <linux/ip.h>
@@ -106,8 +106,7 @@ static bool ttl_tg_check(const struct xt_tgchk_param *par)
106 const struct ipt_TTL_info *info = par->targinfo; 106 const struct ipt_TTL_info *info = par->targinfo;
107 107
108 if (info->mode > IPT_TTL_MAXMODE) { 108 if (info->mode > IPT_TTL_MAXMODE) {
109 printk(KERN_WARNING "ipt_TTL: invalid or unknown Mode %u\n", 109 pr_info("TTL: invalid or unknown mode %u\n", info->mode);
110 info->mode);
111 return false; 110 return false;
112 } 111 }
113 if (info->mode != IPT_TTL_SET && info->ttl == 0) 112 if (info->mode != IPT_TTL_SET && info->ttl == 0)
@@ -120,12 +119,11 @@ static bool hl_tg6_check(const struct xt_tgchk_param *par)
120 const struct ip6t_HL_info *info = par->targinfo; 119 const struct ip6t_HL_info *info = par->targinfo;
121 120
122 if (info->mode > IP6T_HL_MAXMODE) { 121 if (info->mode > IP6T_HL_MAXMODE) {
123 printk(KERN_WARNING "ip6t_HL: invalid or unknown Mode %u\n", 122 pr_info("invalid or unknown mode %u\n", info->mode);
124 info->mode);
125 return false; 123 return false;
126 } 124 }
127 if (info->mode != IP6T_HL_SET && info->hop_limit == 0) { 125 if (info->mode != IP6T_HL_SET && info->hop_limit == 0) {
128 printk(KERN_WARNING "ip6t_HL: increment/decrement doesn't " 126 pr_info("increment/decrement does not "
129 "make sense with value 0\n"); 127 "make sense with value 0\n");
130 return false; 128 return false;
131 } 129 }
diff --git a/net/netfilter/xt_LED.c b/net/netfilter/xt_LED.c
index 0d6c2885ebd6..f511bea9464a 100644
--- a/net/netfilter/xt_LED.c
+++ b/net/netfilter/xt_LED.c
@@ -18,7 +18,7 @@
18 * 02110-1301 USA. 18 * 02110-1301 USA.
19 * 19 *
20 */ 20 */
21 21#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/skbuff.h> 23#include <linux/skbuff.h>
24#include <linux/netfilter/x_tables.h> 24#include <linux/netfilter/x_tables.h>
@@ -87,7 +87,7 @@ static bool led_tg_check(const struct xt_tgchk_param *par)
87 int err; 87 int err;
88 88
89 if (ledinfo->id[0] == '\0') { 89 if (ledinfo->id[0] == '\0') {
90 printk(KERN_ERR KBUILD_MODNAME ": No 'id' parameter given.\n"); 90 pr_info("No 'id' parameter given.\n");
91 return false; 91 return false;
92 } 92 }
93 93
@@ -99,11 +99,9 @@ static bool led_tg_check(const struct xt_tgchk_param *par)
99 99
100 err = led_trigger_register(&ledinternal->netfilter_led_trigger); 100 err = led_trigger_register(&ledinternal->netfilter_led_trigger);
101 if (err) { 101 if (err) {
102 printk(KERN_CRIT KBUILD_MODNAME 102 pr_warning("led_trigger_register() failed\n");
103 ": led_trigger_register() failed\n");
104 if (err == -EEXIST) 103 if (err == -EEXIST)
105 printk(KERN_ERR KBUILD_MODNAME 104 pr_warning("Trigger name is already in use.\n");
106 ": Trigger name is already in use.\n");
107 goto exit_alloc; 105 goto exit_alloc;
108 } 106 }
109 107
diff --git a/net/netfilter/xt_SECMARK.c b/net/netfilter/xt_SECMARK.c
index 7a6f9e6f5dfa..4855fd9d7c6f 100644
--- a/net/netfilter/xt_SECMARK.c
+++ b/net/netfilter/xt_SECMARK.c
@@ -12,6 +12,7 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 * 13 *
14 */ 14 */
15#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
15#include <linux/module.h> 16#include <linux/module.h>
16#include <linux/skbuff.h> 17#include <linux/skbuff.h>
17#include <linux/selinux.h> 18#include <linux/selinux.h>
@@ -59,20 +60,19 @@ static bool checkentry_selinux(struct xt_secmark_target_info *info)
59 err = selinux_string_to_sid(sel->selctx, &sel->selsid); 60 err = selinux_string_to_sid(sel->selctx, &sel->selsid);
60 if (err) { 61 if (err) {
61 if (err == -EINVAL) 62 if (err == -EINVAL)
62 printk(KERN_INFO PFX "invalid SELinux context \'%s\'\n", 63 pr_info("invalid SELinux context \'%s\'\n",
63 sel->selctx); 64 sel->selctx);
64 return false; 65 return false;
65 } 66 }
66 67
67 if (!sel->selsid) { 68 if (!sel->selsid) {
68 printk(KERN_INFO PFX "unable to map SELinux context \'%s\'\n", 69 pr_info("unable to map SELinux context \'%s\'\n", sel->selctx);
69 sel->selctx);
70 return false; 70 return false;
71 } 71 }
72 72
73 err = selinux_secmark_relabel_packet_permission(sel->selsid); 73 err = selinux_secmark_relabel_packet_permission(sel->selsid);
74 if (err) { 74 if (err) {
75 printk(KERN_INFO PFX "unable to obtain relabeling permission\n"); 75 pr_info("unable to obtain relabeling permission\n");
76 return false; 76 return false;
77 } 77 }
78 78
@@ -86,14 +86,14 @@ static bool secmark_tg_check(const struct xt_tgchk_param *par)
86 86
87 if (strcmp(par->table, "mangle") != 0 && 87 if (strcmp(par->table, "mangle") != 0 &&
88 strcmp(par->table, "security") != 0) { 88 strcmp(par->table, "security") != 0) {
89 printk(KERN_INFO PFX "target only valid in the \'mangle\' " 89 pr_info("target only valid in the \'mangle\' "
90 "or \'security\' tables, not \'%s\'.\n", par->table); 90 "or \'security\' tables, not \'%s\'.\n", par->table);
91 return false; 91 return false;
92 } 92 }
93 93
94 if (mode && mode != info->mode) { 94 if (mode && mode != info->mode) {
95 printk(KERN_INFO PFX "mode already set to %hu cannot mix with " 95 pr_info("mode already set to %hu cannot mix with "
96 "rules for mode %hu\n", mode, info->mode); 96 "rules for mode %hu\n", mode, info->mode);
97 return false; 97 return false;
98 } 98 }
99 99
@@ -104,7 +104,7 @@ static bool secmark_tg_check(const struct xt_tgchk_param *par)
104 break; 104 break;
105 105
106 default: 106 default:
107 printk(KERN_INFO PFX "invalid mode: %hu\n", info->mode); 107 pr_info("invalid mode: %hu\n", info->mode);
108 return false; 108 return false;
109 } 109 }
110 110
diff --git a/net/netfilter/xt_TCPMSS.c b/net/netfilter/xt_TCPMSS.c
index 0e357ac9a2a8..2077da31c973 100644
--- a/net/netfilter/xt_TCPMSS.c
+++ b/net/netfilter/xt_TCPMSS.c
@@ -7,7 +7,7 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/skbuff.h> 12#include <linux/skbuff.h>
13#include <linux/ip.h> 13#include <linux/ip.h>
@@ -67,14 +67,14 @@ tcpmss_mangle_packet(struct sk_buff *skb,
67 if (info->mss == XT_TCPMSS_CLAMP_PMTU) { 67 if (info->mss == XT_TCPMSS_CLAMP_PMTU) {
68 if (dst_mtu(skb_dst(skb)) <= minlen) { 68 if (dst_mtu(skb_dst(skb)) <= minlen) {
69 if (net_ratelimit()) 69 if (net_ratelimit())
70 printk(KERN_ERR "xt_TCPMSS: " 70 pr_err("xt_TCPMSS: "
71 "unknown or invalid path-MTU (%u)\n", 71 "unknown or invalid path-MTU (%u)\n",
72 dst_mtu(skb_dst(skb))); 72 dst_mtu(skb_dst(skb)));
73 return -1; 73 return -1;
74 } 74 }
75 if (in_mtu <= minlen) { 75 if (in_mtu <= minlen) {
76 if (net_ratelimit()) 76 if (net_ratelimit())
77 printk(KERN_ERR "xt_TCPMSS: unknown or " 77 pr_err("xt_TCPMSS: unknown or "
78 "invalid path-MTU (%u)\n", in_mtu); 78 "invalid path-MTU (%u)\n", in_mtu);
79 return -1; 79 return -1;
80 } 80 }
@@ -245,14 +245,14 @@ static bool tcpmss_tg4_check(const struct xt_tgchk_param *par)
245 (par->hook_mask & ~((1 << NF_INET_FORWARD) | 245 (par->hook_mask & ~((1 << NF_INET_FORWARD) |
246 (1 << NF_INET_LOCAL_OUT) | 246 (1 << NF_INET_LOCAL_OUT) |
247 (1 << NF_INET_POST_ROUTING))) != 0) { 247 (1 << NF_INET_POST_ROUTING))) != 0) {
248 printk("xt_TCPMSS: path-MTU clamping only supported in " 248 pr_info("path-MTU clamping only supported in "
249 "FORWARD, OUTPUT and POSTROUTING hooks\n"); 249 "FORWARD, OUTPUT and POSTROUTING hooks\n");
250 return false; 250 return false;
251 } 251 }
252 xt_ematch_foreach(ematch, e) 252 xt_ematch_foreach(ematch, e)
253 if (find_syn_match(ematch)) 253 if (find_syn_match(ematch))
254 return true; 254 return true;
255 printk("xt_TCPMSS: Only works on TCP SYN packets\n"); 255 pr_info("Only works on TCP SYN packets\n");
256 return false; 256 return false;
257} 257}
258 258
@@ -267,14 +267,14 @@ static bool tcpmss_tg6_check(const struct xt_tgchk_param *par)
267 (par->hook_mask & ~((1 << NF_INET_FORWARD) | 267 (par->hook_mask & ~((1 << NF_INET_FORWARD) |
268 (1 << NF_INET_LOCAL_OUT) | 268 (1 << NF_INET_LOCAL_OUT) |
269 (1 << NF_INET_POST_ROUTING))) != 0) { 269 (1 << NF_INET_POST_ROUTING))) != 0) {
270 printk("xt_TCPMSS: path-MTU clamping only supported in " 270 pr_info("path-MTU clamping only supported in "
271 "FORWARD, OUTPUT and POSTROUTING hooks\n"); 271 "FORWARD, OUTPUT and POSTROUTING hooks\n");
272 return false; 272 return false;
273 } 273 }
274 xt_ematch_foreach(ematch, e) 274 xt_ematch_foreach(ematch, e)
275 if (find_syn_match(ematch)) 275 if (find_syn_match(ematch))
276 return true; 276 return true;
277 printk("xt_TCPMSS: Only works on TCP SYN packets\n"); 277 pr_info("Only works on TCP SYN packets\n");
278 return false; 278 return false;
279} 279}
280#endif 280#endif
diff --git a/net/netfilter/xt_cluster.c b/net/netfilter/xt_cluster.c
index 225ee3ecd69d..4c273e871301 100644
--- a/net/netfilter/xt_cluster.c
+++ b/net/netfilter/xt_cluster.c
@@ -5,6 +5,7 @@
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
8#include <linux/module.h> 9#include <linux/module.h>
9#include <linux/skbuff.h> 10#include <linux/skbuff.h>
10#include <linux/jhash.h> 11#include <linux/jhash.h>
@@ -136,14 +137,14 @@ static bool xt_cluster_mt_checkentry(const struct xt_mtchk_param *par)
136 struct xt_cluster_match_info *info = par->matchinfo; 137 struct xt_cluster_match_info *info = par->matchinfo;
137 138
138 if (info->total_nodes > XT_CLUSTER_NODES_MAX) { 139 if (info->total_nodes > XT_CLUSTER_NODES_MAX) {
139 printk(KERN_ERR "xt_cluster: you have exceeded the maximum " 140 pr_info("you have exceeded the maximum "
140 "number of cluster nodes (%u > %u)\n", 141 "number of cluster nodes (%u > %u)\n",
141 info->total_nodes, XT_CLUSTER_NODES_MAX); 142 info->total_nodes, XT_CLUSTER_NODES_MAX);
142 return false; 143 return false;
143 } 144 }
144 if (info->node_mask >= (1ULL << info->total_nodes)) { 145 if (info->node_mask >= (1ULL << info->total_nodes)) {
145 printk(KERN_ERR "xt_cluster: this node mask cannot be " 146 pr_info("this node mask cannot be "
146 "higher than the total number of nodes\n"); 147 "higher than the total number of nodes\n");
147 return false; 148 return false;
148 } 149 }
149 return true; 150 return true;
diff --git a/net/netfilter/xt_connbytes.c b/net/netfilter/xt_connbytes.c
index 955e6598a7f0..edb7bbd9ae54 100644
--- a/net/netfilter/xt_connbytes.c
+++ b/net/netfilter/xt_connbytes.c
@@ -1,6 +1,7 @@
1/* Kernel module to match connection tracking byte counter. 1/* Kernel module to match connection tracking byte counter.
2 * GPL (C) 2002 Martin Devera (devik@cdi.cz). 2 * GPL (C) 2002 Martin Devera (devik@cdi.cz).
3 */ 3 */
4#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
4#include <linux/module.h> 5#include <linux/module.h>
5#include <linux/bitops.h> 6#include <linux/bitops.h>
6#include <linux/skbuff.h> 7#include <linux/skbuff.h>
@@ -107,8 +108,8 @@ static bool connbytes_mt_check(const struct xt_mtchk_param *par)
107 return false; 108 return false;
108 109
109 if (nf_ct_l3proto_try_module_get(par->family) < 0) { 110 if (nf_ct_l3proto_try_module_get(par->family) < 0) {
110 printk(KERN_WARNING "can't load conntrack support for " 111 pr_info("cannot load conntrack support for proto=%u\n",
111 "proto=%u\n", par->family); 112 par->family);
112 return false; 113 return false;
113 } 114 }
114 115
diff --git a/net/netfilter/xt_connlimit.c b/net/netfilter/xt_connlimit.c
index 9e624af40f80..d5b26dab9e26 100644
--- a/net/netfilter/xt_connlimit.c
+++ b/net/netfilter/xt_connlimit.c
@@ -11,6 +11,7 @@
11 * Kernel module to match connection tracking information. 11 * Kernel module to match connection tracking information.
12 * GPL (C) 1999 Rusty Russell (rusty@rustcorp.com.au). 12 * GPL (C) 1999 Rusty Russell (rusty@rustcorp.com.au).
13 */ 13 */
14#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
14#include <linux/in.h> 15#include <linux/in.h>
15#include <linux/in6.h> 16#include <linux/in6.h>
16#include <linux/ip.h> 17#include <linux/ip.h>
@@ -225,8 +226,8 @@ static bool connlimit_mt_check(const struct xt_mtchk_param *par)
225 connlimit_rnd_inited = true; 226 connlimit_rnd_inited = true;
226 } 227 }
227 if (nf_ct_l3proto_try_module_get(par->family) < 0) { 228 if (nf_ct_l3proto_try_module_get(par->family) < 0) {
228 printk(KERN_WARNING "cannot load conntrack support for " 229 pr_info("cannot load conntrack support for "
229 "address family %u\n", par->family); 230 "address family %u\n", par->family);
230 return false; 231 return false;
231 } 232 }
232 233
diff --git a/net/netfilter/xt_connmark.c b/net/netfilter/xt_connmark.c
index 97465a472344..7a51ba63f545 100644
--- a/net/netfilter/xt_connmark.c
+++ b/net/netfilter/xt_connmark.c
@@ -77,8 +77,8 @@ connmark_tg(struct sk_buff *skb, const struct xt_target_param *par)
77static bool connmark_tg_check(const struct xt_tgchk_param *par) 77static bool connmark_tg_check(const struct xt_tgchk_param *par)
78{ 78{
79 if (nf_ct_l3proto_try_module_get(par->family) < 0) { 79 if (nf_ct_l3proto_try_module_get(par->family) < 0) {
80 printk(KERN_WARNING "cannot load conntrack support for " 80 pr_info("cannot load conntrack support for proto=%u\n",
81 "proto=%u\n", par->family); 81 par->family);
82 return false; 82 return false;
83 } 83 }
84 return true; 84 return true;
@@ -106,8 +106,8 @@ connmark_mt(const struct sk_buff *skb, const struct xt_match_param *par)
106static bool connmark_mt_check(const struct xt_mtchk_param *par) 106static bool connmark_mt_check(const struct xt_mtchk_param *par)
107{ 107{
108 if (nf_ct_l3proto_try_module_get(par->family) < 0) { 108 if (nf_ct_l3proto_try_module_get(par->family) < 0) {
109 printk(KERN_WARNING "cannot load conntrack support for " 109 pr_info("cannot load conntrack support for proto=%u\n",
110 "proto=%u\n", par->family); 110 par->family);
111 return false; 111 return false;
112 } 112 }
113 return true; 113 return true;
diff --git a/net/netfilter/xt_conntrack.c b/net/netfilter/xt_conntrack.c
index ae66305f0fe5..387172b6b0d8 100644
--- a/net/netfilter/xt_conntrack.c
+++ b/net/netfilter/xt_conntrack.c
@@ -9,7 +9,7 @@
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12 12#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/skbuff.h> 14#include <linux/skbuff.h>
15#include <net/ipv6.h> 15#include <net/ipv6.h>
@@ -209,8 +209,8 @@ conntrack_mt_v2(const struct sk_buff *skb, const struct xt_match_param *par)
209static bool conntrack_mt_check(const struct xt_mtchk_param *par) 209static bool conntrack_mt_check(const struct xt_mtchk_param *par)
210{ 210{
211 if (nf_ct_l3proto_try_module_get(par->family) < 0) { 211 if (nf_ct_l3proto_try_module_get(par->family) < 0) {
212 printk(KERN_WARNING "can't load conntrack support for " 212 pr_info("cannot load conntrack support for proto=%u\n",
213 "proto=%u\n", par->family); 213 par->family);
214 return false; 214 return false;
215 } 215 }
216 return true; 216 return true;
diff --git a/net/netfilter/xt_dscp.c b/net/netfilter/xt_dscp.c
index fe58cd01ef99..6ecedc13db0c 100644
--- a/net/netfilter/xt_dscp.c
+++ b/net/netfilter/xt_dscp.c
@@ -6,7 +6,7 @@
6 * it under the terms of the GNU General Public License version 2 as 6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 */ 8 */
9 9#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/skbuff.h> 11#include <linux/skbuff.h>
12#include <linux/ip.h> 12#include <linux/ip.h>
@@ -47,7 +47,7 @@ static bool dscp_mt_check(const struct xt_mtchk_param *par)
47 const struct xt_dscp_info *info = par->matchinfo; 47 const struct xt_dscp_info *info = par->matchinfo;
48 48
49 if (info->dscp > XT_DSCP_MAX) { 49 if (info->dscp > XT_DSCP_MAX) {
50 printk(KERN_ERR "xt_dscp: dscp %x out of range\n", info->dscp); 50 pr_info("dscp %x out of range\n", info->dscp);
51 return false; 51 return false;
52 } 52 }
53 53
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 52327c5c1f1d..8f3e0c02ca54 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -7,6 +7,7 @@
7 * 7 *
8 * Development of this code was funded by Astaro AG, http://www.astaro.com/ 8 * Development of this code was funded by Astaro AG, http://www.astaro.com/
9 */ 9 */
10#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
10#include <linux/module.h> 11#include <linux/module.h>
11#include <linux/spinlock.h> 12#include <linux/spinlock.h>
12#include <linux/random.h> 13#include <linux/random.h>
@@ -166,17 +167,14 @@ dsthash_alloc_init(struct xt_hashlimit_htable *ht,
166 if (ht->cfg.max && ht->count >= ht->cfg.max) { 167 if (ht->cfg.max && ht->count >= ht->cfg.max) {
167 /* FIXME: do something. question is what.. */ 168 /* FIXME: do something. question is what.. */
168 if (net_ratelimit()) 169 if (net_ratelimit())
169 printk(KERN_WARNING 170 pr_err("max count of %u reached\n", ht->cfg.max);
170 "xt_hashlimit: max count of %u reached\n",
171 ht->cfg.max);
172 return NULL; 171 return NULL;
173 } 172 }
174 173
175 ent = kmem_cache_alloc(hashlimit_cachep, GFP_ATOMIC); 174 ent = kmem_cache_alloc(hashlimit_cachep, GFP_ATOMIC);
176 if (!ent) { 175 if (!ent) {
177 if (net_ratelimit()) 176 if (net_ratelimit())
178 printk(KERN_ERR 177 pr_err("cannot allocate dsthash_ent\n");
179 "xt_hashlimit: can't allocate dsthash_ent\n");
180 return NULL; 178 return NULL;
181 } 179 }
182 memcpy(&ent->dst, dst, sizeof(ent->dst)); 180 memcpy(&ent->dst, dst, sizeof(ent->dst));
@@ -681,8 +679,8 @@ static bool hashlimit_mt_check_v0(const struct xt_mtchk_param *par)
681 /* Check for overflow. */ 679 /* Check for overflow. */
682 if (r->cfg.burst == 0 || 680 if (r->cfg.burst == 0 ||
683 user2credits(r->cfg.avg * r->cfg.burst) < user2credits(r->cfg.avg)) { 681 user2credits(r->cfg.avg * r->cfg.burst) < user2credits(r->cfg.avg)) {
684 printk(KERN_ERR "xt_hashlimit: overflow, try lower: %u/%u\n", 682 pr_info("overflow, try lower: %u/%u\n",
685 r->cfg.avg, r->cfg.burst); 683 r->cfg.avg, r->cfg.burst);
686 return false; 684 return false;
687 } 685 }
688 if (r->cfg.mode == 0 || 686 if (r->cfg.mode == 0 ||
@@ -718,8 +716,8 @@ static bool hashlimit_mt_check(const struct xt_mtchk_param *par)
718 if (info->cfg.burst == 0 || 716 if (info->cfg.burst == 0 ||
719 user2credits(info->cfg.avg * info->cfg.burst) < 717 user2credits(info->cfg.avg * info->cfg.burst) <
720 user2credits(info->cfg.avg)) { 718 user2credits(info->cfg.avg)) {
721 printk(KERN_ERR "xt_hashlimit: overflow, try lower: %u/%u\n", 719 pr_info("overflow, try lower: %u/%u\n",
722 info->cfg.avg, info->cfg.burst); 720 info->cfg.avg, info->cfg.burst);
723 return false; 721 return false;
724 } 722 }
725 if (info->cfg.gc_interval == 0 || info->cfg.expire == 0) 723 if (info->cfg.gc_interval == 0 || info->cfg.expire == 0)
@@ -1018,7 +1016,7 @@ static int __init hashlimit_mt_init(void)
1018 sizeof(struct dsthash_ent), 0, 0, 1016 sizeof(struct dsthash_ent), 0, 0,
1019 NULL); 1017 NULL);
1020 if (!hashlimit_cachep) { 1018 if (!hashlimit_cachep) {
1021 printk(KERN_ERR "xt_hashlimit: unable to create slab cache\n"); 1019 pr_warning("unable to create slab cache\n");
1022 goto err2; 1020 goto err2;
1023 } 1021 }
1024 return 0; 1022 return 0;
diff --git a/net/netfilter/xt_helper.c b/net/netfilter/xt_helper.c
index 64fc7f277221..482aff2ccf7c 100644
--- a/net/netfilter/xt_helper.c
+++ b/net/netfilter/xt_helper.c
@@ -6,7 +6,7 @@
6 * it under the terms of the GNU General Public License version 2 as 6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 */ 8 */
9 9#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/skbuff.h> 11#include <linux/skbuff.h>
12#include <linux/netfilter.h> 12#include <linux/netfilter.h>
@@ -59,8 +59,8 @@ static bool helper_mt_check(const struct xt_mtchk_param *par)
59 struct xt_helper_info *info = par->matchinfo; 59 struct xt_helper_info *info = par->matchinfo;
60 60
61 if (nf_ct_l3proto_try_module_get(par->family) < 0) { 61 if (nf_ct_l3proto_try_module_get(par->family) < 0) {
62 printk(KERN_WARNING "can't load conntrack support for " 62 pr_info("cannot load conntrack support for proto=%u\n",
63 "proto=%u\n", par->family); 63 par->family);
64 return false; 64 return false;
65 } 65 }
66 info->name[29] = '\0'; 66 info->name[29] = '\0';
diff --git a/net/netfilter/xt_hl.c b/net/netfilter/xt_hl.c
index 7726154c87b2..be53f7299623 100644
--- a/net/netfilter/xt_hl.c
+++ b/net/netfilter/xt_hl.c
@@ -39,10 +39,6 @@ static bool ttl_mt(const struct sk_buff *skb, const struct xt_match_param *par)
39 return ttl < info->ttl; 39 return ttl < info->ttl;
40 case IPT_TTL_GT: 40 case IPT_TTL_GT:
41 return ttl > info->ttl; 41 return ttl > info->ttl;
42 default:
43 printk(KERN_WARNING "ipt_ttl: unknown mode %d\n",
44 info->mode);
45 return false;
46 } 42 }
47 43
48 return false; 44 return false;
@@ -56,20 +52,12 @@ static bool hl_mt6(const struct sk_buff *skb, const struct xt_match_param *par)
56 switch (info->mode) { 52 switch (info->mode) {
57 case IP6T_HL_EQ: 53 case IP6T_HL_EQ:
58 return ip6h->hop_limit == info->hop_limit; 54 return ip6h->hop_limit == info->hop_limit;
59 break;
60 case IP6T_HL_NE: 55 case IP6T_HL_NE:
61 return ip6h->hop_limit != info->hop_limit; 56 return ip6h->hop_limit != info->hop_limit;
62 break;
63 case IP6T_HL_LT: 57 case IP6T_HL_LT:
64 return ip6h->hop_limit < info->hop_limit; 58 return ip6h->hop_limit < info->hop_limit;
65 break;
66 case IP6T_HL_GT: 59 case IP6T_HL_GT:
67 return ip6h->hop_limit > info->hop_limit; 60 return ip6h->hop_limit > info->hop_limit;
68 break;
69 default:
70 printk(KERN_WARNING "ip6t_hl: unknown mode %d\n",
71 info->mode);
72 return false;
73 } 61 }
74 62
75 return false; 63 return false;
diff --git a/net/netfilter/xt_limit.c b/net/netfilter/xt_limit.c
index a0ca5339af41..b3dfca63fa52 100644
--- a/net/netfilter/xt_limit.c
+++ b/net/netfilter/xt_limit.c
@@ -5,7 +5,7 @@
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/skbuff.h> 10#include <linux/skbuff.h>
11#include <linux/spinlock.h> 11#include <linux/spinlock.h>
@@ -105,8 +105,8 @@ static bool limit_mt_check(const struct xt_mtchk_param *par)
105 /* Check for overflow. */ 105 /* Check for overflow. */
106 if (r->burst == 0 106 if (r->burst == 0
107 || user2credits(r->avg * r->burst) < user2credits(r->avg)) { 107 || user2credits(r->avg * r->burst) < user2credits(r->avg)) {
108 printk("Overflow in xt_limit, try lower: %u/%u\n", 108 pr_info("Overflow, try lower: %u/%u\n",
109 r->avg, r->burst); 109 r->avg, r->burst);
110 return false; 110 return false;
111 } 111 }
112 112
diff --git a/net/netfilter/xt_osf.c b/net/netfilter/xt_osf.c
index 4169e200588d..8dcde13a0781 100644
--- a/net/netfilter/xt_osf.c
+++ b/net/netfilter/xt_osf.c
@@ -16,7 +16,7 @@
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19 19#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22 22
@@ -382,14 +382,14 @@ static int __init xt_osf_init(void)
382 382
383 err = nfnetlink_subsys_register(&xt_osf_nfnetlink); 383 err = nfnetlink_subsys_register(&xt_osf_nfnetlink);
384 if (err < 0) { 384 if (err < 0) {
385 printk(KERN_ERR "Failed (%d) to register OSF nsfnetlink helper.\n", err); 385 pr_err("Failed to register OSF nsfnetlink helper (%d)\n", err);
386 goto err_out_exit; 386 goto err_out_exit;
387 } 387 }
388 388
389 err = xt_register_match(&xt_osf_match); 389 err = xt_register_match(&xt_osf_match);
390 if (err) { 390 if (err) {
391 printk(KERN_ERR "Failed (%d) to register OS fingerprint " 391 pr_err("Failed to register OS fingerprint "
392 "matching module.\n", err); 392 "matching module (%d)\n", err);
393 goto err_out_remove; 393 goto err_out_remove;
394 } 394 }
395 395
diff --git a/net/netfilter/xt_physdev.c b/net/netfilter/xt_physdev.c
index 8d28ca5848bc..3d42a278408f 100644
--- a/net/netfilter/xt_physdev.c
+++ b/net/netfilter/xt_physdev.c
@@ -7,7 +7,7 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/skbuff.h> 12#include <linux/skbuff.h>
13#include <linux/netfilter_bridge.h> 13#include <linux/netfilter_bridge.h>
@@ -95,9 +95,9 @@ static bool physdev_mt_check(const struct xt_mtchk_param *par)
95 info->invert & XT_PHYSDEV_OP_BRIDGED) && 95 info->invert & XT_PHYSDEV_OP_BRIDGED) &&
96 par->hook_mask & ((1 << NF_INET_LOCAL_OUT) | 96 par->hook_mask & ((1 << NF_INET_LOCAL_OUT) |
97 (1 << NF_INET_FORWARD) | (1 << NF_INET_POST_ROUTING))) { 97 (1 << NF_INET_FORWARD) | (1 << NF_INET_POST_ROUTING))) {
98 printk(KERN_WARNING "physdev match: using --physdev-out in the " 98 pr_info("using --physdev-out in the OUTPUT, FORWARD and "
99 "OUTPUT, FORWARD and POSTROUTING chains for non-bridged " 99 "POSTROUTING chains for non-bridged traffic is not "
100 "traffic is not supported anymore.\n"); 100 "supported anymore.\n");
101 if (par->hook_mask & (1 << NF_INET_LOCAL_OUT)) 101 if (par->hook_mask & (1 << NF_INET_LOCAL_OUT))
102 return false; 102 return false;
103 } 103 }
diff --git a/net/netfilter/xt_policy.c b/net/netfilter/xt_policy.c
index cc033d2c35ea..de3aded6afb8 100644
--- a/net/netfilter/xt_policy.c
+++ b/net/netfilter/xt_policy.c
@@ -6,7 +6,7 @@
6 * it under the terms of the GNU General Public License version 2 as 6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 */ 8 */
9 9#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/skbuff.h> 12#include <linux/skbuff.h>
@@ -133,24 +133,21 @@ static bool policy_mt_check(const struct xt_mtchk_param *par)
133 const struct xt_policy_info *info = par->matchinfo; 133 const struct xt_policy_info *info = par->matchinfo;
134 134
135 if (!(info->flags & (XT_POLICY_MATCH_IN|XT_POLICY_MATCH_OUT))) { 135 if (!(info->flags & (XT_POLICY_MATCH_IN|XT_POLICY_MATCH_OUT))) {
136 printk(KERN_ERR "xt_policy: neither incoming nor " 136 pr_info("neither incoming nor outgoing policy selected\n");
137 "outgoing policy selected\n");
138 return false; 137 return false;
139 } 138 }
140 if (par->hook_mask & ((1 << NF_INET_PRE_ROUTING) | 139 if (par->hook_mask & ((1 << NF_INET_PRE_ROUTING) |
141 (1 << NF_INET_LOCAL_IN)) && info->flags & XT_POLICY_MATCH_OUT) { 140 (1 << NF_INET_LOCAL_IN)) && info->flags & XT_POLICY_MATCH_OUT) {
142 printk(KERN_ERR "xt_policy: output policy not valid in " 141 pr_info("output policy not valid in PREROUTING and INPUT\n");
143 "PRE_ROUTING and INPUT\n");
144 return false; 142 return false;
145 } 143 }
146 if (par->hook_mask & ((1 << NF_INET_POST_ROUTING) | 144 if (par->hook_mask & ((1 << NF_INET_POST_ROUTING) |
147 (1 << NF_INET_LOCAL_OUT)) && info->flags & XT_POLICY_MATCH_IN) { 145 (1 << NF_INET_LOCAL_OUT)) && info->flags & XT_POLICY_MATCH_IN) {
148 printk(KERN_ERR "xt_policy: input policy not valid in " 146 pr_info("input policy not valid in POSTROUTING and OUTPUT\n");
149 "POST_ROUTING and OUTPUT\n");
150 return false; 147 return false;
151 } 148 }
152 if (info->len > XT_POLICY_MAX_ELEM) { 149 if (info->len > XT_POLICY_MAX_ELEM) {
153 printk(KERN_ERR "xt_policy: too many policy elements\n"); 150 pr_info("too many policy elements\n");
154 return false; 151 return false;
155 } 152 }
156 return true; 153 return true;
diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c
index a0ea1a21c470..aa9817e91338 100644
--- a/net/netfilter/xt_recent.c
+++ b/net/netfilter/xt_recent.c
@@ -12,6 +12,7 @@
12 * Author: Stephen Frost <sfrost@snowman.net> 12 * Author: Stephen Frost <sfrost@snowman.net>
13 * Copyright 2002-2003, Stephen Frost, 2.5.x port by laforge@netfilter.org 13 * Copyright 2002-2003, Stephen Frost, 2.5.x port by laforge@netfilter.org
14 */ 14 */
15#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
15#include <linux/init.h> 16#include <linux/init.h>
16#include <linux/ip.h> 17#include <linux/ip.h>
17#include <linux/ipv6.h> 18#include <linux/ipv6.h>
@@ -520,7 +521,7 @@ recent_mt_proc_write(struct file *file, const char __user *input,
520 add = true; 521 add = true;
521 break; 522 break;
522 default: 523 default:
523 printk(KERN_INFO KBUILD_MODNAME ": Need +ip, -ip or /\n"); 524 pr_info("Need \"+ip\", \"-ip\" or \"/\"\n");
524 return -EINVAL; 525 return -EINVAL;
525 } 526 }
526 527
@@ -535,8 +536,7 @@ recent_mt_proc_write(struct file *file, const char __user *input,
535 } 536 }
536 537
537 if (!succ) { 538 if (!succ) {
538 printk(KERN_INFO KBUILD_MODNAME ": illegal address written " 539 pr_info("illegal address written to procfs\n");
539 "to procfs\n");
540 return -EINVAL; 540 return -EINVAL;
541 } 541 }
542 542
diff --git a/net/netfilter/xt_state.c b/net/netfilter/xt_state.c
index ef09b2e2970f..94893be80276 100644
--- a/net/netfilter/xt_state.c
+++ b/net/netfilter/xt_state.c
@@ -40,8 +40,8 @@ state_mt(const struct sk_buff *skb, const struct xt_match_param *par)
40static bool state_mt_check(const struct xt_mtchk_param *par) 40static bool state_mt_check(const struct xt_mtchk_param *par)
41{ 41{
42 if (nf_ct_l3proto_try_module_get(par->family) < 0) { 42 if (nf_ct_l3proto_try_module_get(par->family) < 0) {
43 printk(KERN_WARNING "can't load conntrack support for " 43 pr_info("cannot load conntrack support for proto=%u\n",
44 "proto=%u\n", par->family); 44 par->family);
45 return false; 45 return false;
46 } 46 }
47 return true; 47 return true;