aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-09-10 00:17:32 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-10 15:40:10 -0400
commitb167a37c7bbc6f7589f439ba7d9a49af5ad37ff5 (patch)
treef4007da67ea5bdd707475df3150f592396219f9b
parent47c4cfc37fb71e0fa801a4ed9228de83404abfce (diff)
netfilter: Convert pr_warning to pr_warn
Use the more common pr_warn. Other miscellanea: o Coalesce formats o Realign arguments Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/netfilter/ipset/ip_set_core.c23
-rw-r--r--net/netfilter/ipset/ip_set_hash_gen.h12
-rw-r--r--net/netfilter/xt_connbytes.c2
-rw-r--r--net/netfilter/xt_hashlimit.c2
-rw-r--r--net/netfilter/xt_set.c36
5 files changed, 35 insertions, 40 deletions
diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
index ec8114fae50b..5593e97426c4 100644
--- a/net/netfilter/ipset/ip_set_core.c
+++ b/net/netfilter/ipset/ip_set_core.c
@@ -101,7 +101,7 @@ load_settype(const char *name)
101 nfnl_unlock(NFNL_SUBSYS_IPSET); 101 nfnl_unlock(NFNL_SUBSYS_IPSET);
102 pr_debug("try to load ip_set_%s\n", name); 102 pr_debug("try to load ip_set_%s\n", name);
103 if (request_module("ip_set_%s", name) < 0) { 103 if (request_module("ip_set_%s", name) < 0) {
104 pr_warning("Can't find ip_set type %s\n", name); 104 pr_warn("Can't find ip_set type %s\n", name);
105 nfnl_lock(NFNL_SUBSYS_IPSET); 105 nfnl_lock(NFNL_SUBSYS_IPSET);
106 return false; 106 return false;
107 } 107 }
@@ -195,20 +195,19 @@ ip_set_type_register(struct ip_set_type *type)
195 int ret = 0; 195 int ret = 0;
196 196
197 if (type->protocol != IPSET_PROTOCOL) { 197 if (type->protocol != IPSET_PROTOCOL) {
198 pr_warning("ip_set type %s, family %s, revision %u:%u uses " 198 pr_warn("ip_set type %s, family %s, revision %u:%u uses wrong protocol version %u (want %u)\n",
199 "wrong protocol version %u (want %u)\n", 199 type->name, family_name(type->family),
200 type->name, family_name(type->family), 200 type->revision_min, type->revision_max,
201 type->revision_min, type->revision_max, 201 type->protocol, IPSET_PROTOCOL);
202 type->protocol, IPSET_PROTOCOL);
203 return -EINVAL; 202 return -EINVAL;
204 } 203 }
205 204
206 ip_set_type_lock(); 205 ip_set_type_lock();
207 if (find_set_type(type->name, type->family, type->revision_min)) { 206 if (find_set_type(type->name, type->family, type->revision_min)) {
208 /* Duplicate! */ 207 /* Duplicate! */
209 pr_warning("ip_set type %s, family %s with revision min %u " 208 pr_warn("ip_set type %s, family %s with revision min %u already registered!\n",
210 "already registered!\n", type->name, 209 type->name, family_name(type->family),
211 family_name(type->family), type->revision_min); 210 type->revision_min);
212 ret = -EINVAL; 211 ret = -EINVAL;
213 goto unlock; 212 goto unlock;
214 } 213 }
@@ -228,9 +227,9 @@ ip_set_type_unregister(struct ip_set_type *type)
228{ 227{
229 ip_set_type_lock(); 228 ip_set_type_lock();
230 if (!find_set_type(type->name, type->family, type->revision_min)) { 229 if (!find_set_type(type->name, type->family, type->revision_min)) {
231 pr_warning("ip_set type %s, family %s with revision min %u " 230 pr_warn("ip_set type %s, family %s with revision min %u not registered\n",
232 "not registered\n", type->name, 231 type->name, family_name(type->family),
233 family_name(type->family), type->revision_min); 232 type->revision_min);
234 goto unlock; 233 goto unlock;
235 } 234 }
236 list_del_rcu(&type->list); 235 list_del_rcu(&type->list);
diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h
index 61c7fb052802..80f49dfba555 100644
--- a/net/netfilter/ipset/ip_set_hash_gen.h
+++ b/net/netfilter/ipset/ip_set_hash_gen.h
@@ -565,8 +565,8 @@ retry:
565 set->name, orig->htable_bits, htable_bits, orig); 565 set->name, orig->htable_bits, htable_bits, orig);
566 if (!htable_bits) { 566 if (!htable_bits) {
567 /* In case we have plenty of memory :-) */ 567 /* In case we have plenty of memory :-) */
568 pr_warning("Cannot increase the hashsize of set %s further\n", 568 pr_warn("Cannot increase the hashsize of set %s further\n",
569 set->name); 569 set->name);
570 return -IPSET_ERR_HASH_FULL; 570 return -IPSET_ERR_HASH_FULL;
571 } 571 }
572 t = ip_set_alloc(sizeof(*t) 572 t = ip_set_alloc(sizeof(*t)
@@ -651,8 +651,8 @@ mtype_add(struct ip_set *set, void *value, const struct ip_set_ext *ext,
651 651
652 if (h->elements >= h->maxelem) { 652 if (h->elements >= h->maxelem) {
653 if (net_ratelimit()) 653 if (net_ratelimit())
654 pr_warning("Set %s is full, maxelem %u reached\n", 654 pr_warn("Set %s is full, maxelem %u reached\n",
655 set->name, h->maxelem); 655 set->name, h->maxelem);
656 return -IPSET_ERR_HASH_FULL; 656 return -IPSET_ERR_HASH_FULL;
657 } 657 }
658 658
@@ -998,8 +998,8 @@ mtype_list(const struct ip_set *set,
998nla_put_failure: 998nla_put_failure:
999 nlmsg_trim(skb, incomplete); 999 nlmsg_trim(skb, incomplete);
1000 if (unlikely(first == cb->args[IPSET_CB_ARG0])) { 1000 if (unlikely(first == cb->args[IPSET_CB_ARG0])) {
1001 pr_warning("Can't list set %s: one bucket does not fit into " 1001 pr_warn("Can't list set %s: one bucket does not fit into a message. Please report it!\n",
1002 "a message. Please report it!\n", set->name); 1002 set->name);
1003 cb->args[IPSET_CB_ARG0] = 0; 1003 cb->args[IPSET_CB_ARG0] = 0;
1004 return -EMSGSIZE; 1004 return -EMSGSIZE;
1005 } 1005 }
diff --git a/net/netfilter/xt_connbytes.c b/net/netfilter/xt_connbytes.c
index 1e634615ab9d..d4bec261e74e 100644
--- a/net/netfilter/xt_connbytes.c
+++ b/net/netfilter/xt_connbytes.c
@@ -120,7 +120,7 @@ static int connbytes_mt_check(const struct xt_mtchk_param *par)
120 * accounting is enabled, so complain in the hope that someone notices. 120 * accounting is enabled, so complain in the hope that someone notices.
121 */ 121 */
122 if (!nf_ct_acct_enabled(par->net)) { 122 if (!nf_ct_acct_enabled(par->net)) {
123 pr_warning("Forcing CT accounting to be enabled\n"); 123 pr_warn("Forcing CT accounting to be enabled\n");
124 nf_ct_set_acct(par->net, true); 124 nf_ct_set_acct(par->net, true);
125 } 125 }
126 126
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 52eb3e03458d..05fbc2a0be46 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -943,7 +943,7 @@ static int __init hashlimit_mt_init(void)
943 sizeof(struct dsthash_ent), 0, 0, 943 sizeof(struct dsthash_ent), 0, 0,
944 NULL); 944 NULL);
945 if (!hashlimit_cachep) { 945 if (!hashlimit_cachep) {
946 pr_warning("unable to create slab cache\n"); 946 pr_warn("unable to create slab cache\n");
947 goto err2; 947 goto err2;
948 } 948 }
949 return 0; 949 return 0;
diff --git a/net/netfilter/xt_set.c b/net/netfilter/xt_set.c
index 80c2e2d603e0..cb70f6ec5695 100644
--- a/net/netfilter/xt_set.c
+++ b/net/netfilter/xt_set.c
@@ -84,13 +84,12 @@ set_match_v0_checkentry(const struct xt_mtchk_param *par)
84 index = ip_set_nfnl_get_byindex(par->net, info->match_set.index); 84 index = ip_set_nfnl_get_byindex(par->net, info->match_set.index);
85 85
86 if (index == IPSET_INVALID_ID) { 86 if (index == IPSET_INVALID_ID) {
87 pr_warning("Cannot find set identified by id %u to match\n", 87 pr_warn("Cannot find set identified by id %u to match\n",
88 info->match_set.index); 88 info->match_set.index);
89 return -ENOENT; 89 return -ENOENT;
90 } 90 }
91 if (info->match_set.u.flags[IPSET_DIM_MAX-1] != 0) { 91 if (info->match_set.u.flags[IPSET_DIM_MAX-1] != 0) {
92 pr_warning("Protocol error: set match dimension " 92 pr_warn("Protocol error: set match dimension is over the limit!\n");
93 "is over the limit!\n");
94 ip_set_nfnl_put(par->net, info->match_set.index); 93 ip_set_nfnl_put(par->net, info->match_set.index);
95 return -ERANGE; 94 return -ERANGE;
96 } 95 }
@@ -134,13 +133,12 @@ set_match_v1_checkentry(const struct xt_mtchk_param *par)
134 index = ip_set_nfnl_get_byindex(par->net, info->match_set.index); 133 index = ip_set_nfnl_get_byindex(par->net, info->match_set.index);
135 134
136 if (index == IPSET_INVALID_ID) { 135 if (index == IPSET_INVALID_ID) {
137 pr_warning("Cannot find set identified by id %u to match\n", 136 pr_warn("Cannot find set identified by id %u to match\n",
138 info->match_set.index); 137 info->match_set.index);
139 return -ENOENT; 138 return -ENOENT;
140 } 139 }
141 if (info->match_set.dim > IPSET_DIM_MAX) { 140 if (info->match_set.dim > IPSET_DIM_MAX) {
142 pr_warning("Protocol error: set match dimension " 141 pr_warn("Protocol error: set match dimension is over the limit!\n");
143 "is over the limit!\n");
144 ip_set_nfnl_put(par->net, info->match_set.index); 142 ip_set_nfnl_put(par->net, info->match_set.index);
145 return -ERANGE; 143 return -ERANGE;
146 } 144 }
@@ -230,8 +228,8 @@ set_target_v0_checkentry(const struct xt_tgchk_param *par)
230 if (info->add_set.index != IPSET_INVALID_ID) { 228 if (info->add_set.index != IPSET_INVALID_ID) {
231 index = ip_set_nfnl_get_byindex(par->net, info->add_set.index); 229 index = ip_set_nfnl_get_byindex(par->net, info->add_set.index);
232 if (index == IPSET_INVALID_ID) { 230 if (index == IPSET_INVALID_ID) {
233 pr_warning("Cannot find add_set index %u as target\n", 231 pr_warn("Cannot find add_set index %u as target\n",
234 info->add_set.index); 232 info->add_set.index);
235 return -ENOENT; 233 return -ENOENT;
236 } 234 }
237 } 235 }
@@ -239,8 +237,8 @@ set_target_v0_checkentry(const struct xt_tgchk_param *par)
239 if (info->del_set.index != IPSET_INVALID_ID) { 237 if (info->del_set.index != IPSET_INVALID_ID) {
240 index = ip_set_nfnl_get_byindex(par->net, info->del_set.index); 238 index = ip_set_nfnl_get_byindex(par->net, info->del_set.index);
241 if (index == IPSET_INVALID_ID) { 239 if (index == IPSET_INVALID_ID) {
242 pr_warning("Cannot find del_set index %u as target\n", 240 pr_warn("Cannot find del_set index %u as target\n",
243 info->del_set.index); 241 info->del_set.index);
244 if (info->add_set.index != IPSET_INVALID_ID) 242 if (info->add_set.index != IPSET_INVALID_ID)
245 ip_set_nfnl_put(par->net, info->add_set.index); 243 ip_set_nfnl_put(par->net, info->add_set.index);
246 return -ENOENT; 244 return -ENOENT;
@@ -248,8 +246,7 @@ set_target_v0_checkentry(const struct xt_tgchk_param *par)
248 } 246 }
249 if (info->add_set.u.flags[IPSET_DIM_MAX-1] != 0 || 247 if (info->add_set.u.flags[IPSET_DIM_MAX-1] != 0 ||
250 info->del_set.u.flags[IPSET_DIM_MAX-1] != 0) { 248 info->del_set.u.flags[IPSET_DIM_MAX-1] != 0) {
251 pr_warning("Protocol error: SET target dimension " 249 pr_warn("Protocol error: SET target dimension is over the limit!\n");
252 "is over the limit!\n");
253 if (info->add_set.index != IPSET_INVALID_ID) 250 if (info->add_set.index != IPSET_INVALID_ID)
254 ip_set_nfnl_put(par->net, info->add_set.index); 251 ip_set_nfnl_put(par->net, info->add_set.index);
255 if (info->del_set.index != IPSET_INVALID_ID) 252 if (info->del_set.index != IPSET_INVALID_ID)
@@ -303,8 +300,8 @@ set_target_v1_checkentry(const struct xt_tgchk_param *par)
303 if (info->add_set.index != IPSET_INVALID_ID) { 300 if (info->add_set.index != IPSET_INVALID_ID) {
304 index = ip_set_nfnl_get_byindex(par->net, info->add_set.index); 301 index = ip_set_nfnl_get_byindex(par->net, info->add_set.index);
305 if (index == IPSET_INVALID_ID) { 302 if (index == IPSET_INVALID_ID) {
306 pr_warning("Cannot find add_set index %u as target\n", 303 pr_warn("Cannot find add_set index %u as target\n",
307 info->add_set.index); 304 info->add_set.index);
308 return -ENOENT; 305 return -ENOENT;
309 } 306 }
310 } 307 }
@@ -312,8 +309,8 @@ set_target_v1_checkentry(const struct xt_tgchk_param *par)
312 if (info->del_set.index != IPSET_INVALID_ID) { 309 if (info->del_set.index != IPSET_INVALID_ID) {
313 index = ip_set_nfnl_get_byindex(par->net, info->del_set.index); 310 index = ip_set_nfnl_get_byindex(par->net, info->del_set.index);
314 if (index == IPSET_INVALID_ID) { 311 if (index == IPSET_INVALID_ID) {
315 pr_warning("Cannot find del_set index %u as target\n", 312 pr_warn("Cannot find del_set index %u as target\n",
316 info->del_set.index); 313 info->del_set.index);
317 if (info->add_set.index != IPSET_INVALID_ID) 314 if (info->add_set.index != IPSET_INVALID_ID)
318 ip_set_nfnl_put(par->net, info->add_set.index); 315 ip_set_nfnl_put(par->net, info->add_set.index);
319 return -ENOENT; 316 return -ENOENT;
@@ -321,8 +318,7 @@ set_target_v1_checkentry(const struct xt_tgchk_param *par)
321 } 318 }
322 if (info->add_set.dim > IPSET_DIM_MAX || 319 if (info->add_set.dim > IPSET_DIM_MAX ||
323 info->del_set.dim > IPSET_DIM_MAX) { 320 info->del_set.dim > IPSET_DIM_MAX) {
324 pr_warning("Protocol error: SET target dimension " 321 pr_warn("Protocol error: SET target dimension is over the limit!\n");
325 "is over the limit!\n");
326 if (info->add_set.index != IPSET_INVALID_ID) 322 if (info->add_set.index != IPSET_INVALID_ID)
327 ip_set_nfnl_put(par->net, info->add_set.index); 323 ip_set_nfnl_put(par->net, info->add_set.index);
328 if (info->del_set.index != IPSET_INVALID_ID) 324 if (info->del_set.index != IPSET_INVALID_ID)