Commit b167a37c authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

netfilter: Convert pr_warning to pr_warn

Use the more common pr_warn.

Other miscellanea:

o Coalesce formats
o Realign arguments
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 47c4cfc3
...@@ -101,7 +101,7 @@ load_settype(const char *name) ...@@ -101,7 +101,7 @@ load_settype(const char *name)
nfnl_unlock(NFNL_SUBSYS_IPSET); nfnl_unlock(NFNL_SUBSYS_IPSET);
pr_debug("try to load ip_set_%s\n", name); pr_debug("try to load ip_set_%s\n", name);
if (request_module("ip_set_%s", name) < 0) { if (request_module("ip_set_%s", name) < 0) {
pr_warning("Can't find ip_set type %s\n", name); pr_warn("Can't find ip_set type %s\n", name);
nfnl_lock(NFNL_SUBSYS_IPSET); nfnl_lock(NFNL_SUBSYS_IPSET);
return false; return false;
} }
...@@ -195,8 +195,7 @@ ip_set_type_register(struct ip_set_type *type) ...@@ -195,8 +195,7 @@ ip_set_type_register(struct ip_set_type *type)
int ret = 0; int ret = 0;
if (type->protocol != IPSET_PROTOCOL) { if (type->protocol != IPSET_PROTOCOL) {
pr_warning("ip_set type %s, family %s, revision %u:%u uses " pr_warn("ip_set type %s, family %s, revision %u:%u uses wrong protocol version %u (want %u)\n",
"wrong protocol version %u (want %u)\n",
type->name, family_name(type->family), type->name, family_name(type->family),
type->revision_min, type->revision_max, type->revision_min, type->revision_max,
type->protocol, IPSET_PROTOCOL); type->protocol, IPSET_PROTOCOL);
...@@ -206,9 +205,9 @@ ip_set_type_register(struct ip_set_type *type) ...@@ -206,9 +205,9 @@ ip_set_type_register(struct ip_set_type *type)
ip_set_type_lock(); ip_set_type_lock();
if (find_set_type(type->name, type->family, type->revision_min)) { if (find_set_type(type->name, type->family, type->revision_min)) {
/* Duplicate! */ /* Duplicate! */
pr_warning("ip_set type %s, family %s with revision min %u " pr_warn("ip_set type %s, family %s with revision min %u already registered!\n",
"already registered!\n", type->name, type->name, family_name(type->family),
family_name(type->family), type->revision_min); type->revision_min);
ret = -EINVAL; ret = -EINVAL;
goto unlock; goto unlock;
} }
...@@ -228,9 +227,9 @@ ip_set_type_unregister(struct ip_set_type *type) ...@@ -228,9 +227,9 @@ ip_set_type_unregister(struct ip_set_type *type)
{ {
ip_set_type_lock(); ip_set_type_lock();
if (!find_set_type(type->name, type->family, type->revision_min)) { if (!find_set_type(type->name, type->family, type->revision_min)) {
pr_warning("ip_set type %s, family %s with revision min %u " pr_warn("ip_set type %s, family %s with revision min %u not registered\n",
"not registered\n", type->name, type->name, family_name(type->family),
family_name(type->family), type->revision_min); type->revision_min);
goto unlock; goto unlock;
} }
list_del_rcu(&type->list); list_del_rcu(&type->list);
......
...@@ -565,7 +565,7 @@ mtype_resize(struct ip_set *set, bool retried) ...@@ -565,7 +565,7 @@ mtype_resize(struct ip_set *set, bool retried)
set->name, orig->htable_bits, htable_bits, orig); set->name, orig->htable_bits, htable_bits, orig);
if (!htable_bits) { if (!htable_bits) {
/* In case we have plenty of memory :-) */ /* In case we have plenty of memory :-) */
pr_warning("Cannot increase the hashsize of set %s further\n", pr_warn("Cannot increase the hashsize of set %s further\n",
set->name); set->name);
return -IPSET_ERR_HASH_FULL; return -IPSET_ERR_HASH_FULL;
} }
...@@ -651,7 +651,7 @@ mtype_add(struct ip_set *set, void *value, const struct ip_set_ext *ext, ...@@ -651,7 +651,7 @@ mtype_add(struct ip_set *set, void *value, const struct ip_set_ext *ext,
if (h->elements >= h->maxelem) { if (h->elements >= h->maxelem) {
if (net_ratelimit()) if (net_ratelimit())
pr_warning("Set %s is full, maxelem %u reached\n", pr_warn("Set %s is full, maxelem %u reached\n",
set->name, h->maxelem); set->name, h->maxelem);
return -IPSET_ERR_HASH_FULL; return -IPSET_ERR_HASH_FULL;
} }
...@@ -998,8 +998,8 @@ mtype_list(const struct ip_set *set, ...@@ -998,8 +998,8 @@ mtype_list(const struct ip_set *set,
nla_put_failure: nla_put_failure:
nlmsg_trim(skb, incomplete); nlmsg_trim(skb, incomplete);
if (unlikely(first == cb->args[IPSET_CB_ARG0])) { if (unlikely(first == cb->args[IPSET_CB_ARG0])) {
pr_warning("Can't list set %s: one bucket does not fit into " pr_warn("Can't list set %s: one bucket does not fit into a message. Please report it!\n",
"a message. Please report it!\n", set->name); set->name);
cb->args[IPSET_CB_ARG0] = 0; cb->args[IPSET_CB_ARG0] = 0;
return -EMSGSIZE; return -EMSGSIZE;
} }
......
...@@ -120,7 +120,7 @@ static int connbytes_mt_check(const struct xt_mtchk_param *par) ...@@ -120,7 +120,7 @@ static int connbytes_mt_check(const struct xt_mtchk_param *par)
* accounting is enabled, so complain in the hope that someone notices. * accounting is enabled, so complain in the hope that someone notices.
*/ */
if (!nf_ct_acct_enabled(par->net)) { if (!nf_ct_acct_enabled(par->net)) {
pr_warning("Forcing CT accounting to be enabled\n"); pr_warn("Forcing CT accounting to be enabled\n");
nf_ct_set_acct(par->net, true); nf_ct_set_acct(par->net, true);
} }
......
...@@ -943,7 +943,7 @@ static int __init hashlimit_mt_init(void) ...@@ -943,7 +943,7 @@ static int __init hashlimit_mt_init(void)
sizeof(struct dsthash_ent), 0, 0, sizeof(struct dsthash_ent), 0, 0,
NULL); NULL);
if (!hashlimit_cachep) { if (!hashlimit_cachep) {
pr_warning("unable to create slab cache\n"); pr_warn("unable to create slab cache\n");
goto err2; goto err2;
} }
return 0; return 0;
......
...@@ -84,13 +84,12 @@ set_match_v0_checkentry(const struct xt_mtchk_param *par) ...@@ -84,13 +84,12 @@ set_match_v0_checkentry(const struct xt_mtchk_param *par)
index = ip_set_nfnl_get_byindex(par->net, info->match_set.index); index = ip_set_nfnl_get_byindex(par->net, info->match_set.index);
if (index == IPSET_INVALID_ID) { if (index == IPSET_INVALID_ID) {
pr_warning("Cannot find set identified by id %u to match\n", pr_warn("Cannot find set identified by id %u to match\n",
info->match_set.index); info->match_set.index);
return -ENOENT; return -ENOENT;
} }
if (info->match_set.u.flags[IPSET_DIM_MAX-1] != 0) { if (info->match_set.u.flags[IPSET_DIM_MAX-1] != 0) {
pr_warning("Protocol error: set match dimension " pr_warn("Protocol error: set match dimension is over the limit!\n");
"is over the limit!\n");
ip_set_nfnl_put(par->net, info->match_set.index); ip_set_nfnl_put(par->net, info->match_set.index);
return -ERANGE; return -ERANGE;
} }
...@@ -134,13 +133,12 @@ set_match_v1_checkentry(const struct xt_mtchk_param *par) ...@@ -134,13 +133,12 @@ set_match_v1_checkentry(const struct xt_mtchk_param *par)
index = ip_set_nfnl_get_byindex(par->net, info->match_set.index); index = ip_set_nfnl_get_byindex(par->net, info->match_set.index);
if (index == IPSET_INVALID_ID) { if (index == IPSET_INVALID_ID) {
pr_warning("Cannot find set identified by id %u to match\n", pr_warn("Cannot find set identified by id %u to match\n",
info->match_set.index); info->match_set.index);
return -ENOENT; return -ENOENT;
} }
if (info->match_set.dim > IPSET_DIM_MAX) { if (info->match_set.dim > IPSET_DIM_MAX) {
pr_warning("Protocol error: set match dimension " pr_warn("Protocol error: set match dimension is over the limit!\n");
"is over the limit!\n");
ip_set_nfnl_put(par->net, info->match_set.index); ip_set_nfnl_put(par->net, info->match_set.index);
return -ERANGE; return -ERANGE;
} }
...@@ -230,7 +228,7 @@ set_target_v0_checkentry(const struct xt_tgchk_param *par) ...@@ -230,7 +228,7 @@ set_target_v0_checkentry(const struct xt_tgchk_param *par)
if (info->add_set.index != IPSET_INVALID_ID) { if (info->add_set.index != IPSET_INVALID_ID) {
index = ip_set_nfnl_get_byindex(par->net, info->add_set.index); index = ip_set_nfnl_get_byindex(par->net, info->add_set.index);
if (index == IPSET_INVALID_ID) { if (index == IPSET_INVALID_ID) {
pr_warning("Cannot find add_set index %u as target\n", pr_warn("Cannot find add_set index %u as target\n",
info->add_set.index); info->add_set.index);
return -ENOENT; return -ENOENT;
} }
...@@ -239,7 +237,7 @@ set_target_v0_checkentry(const struct xt_tgchk_param *par) ...@@ -239,7 +237,7 @@ set_target_v0_checkentry(const struct xt_tgchk_param *par)
if (info->del_set.index != IPSET_INVALID_ID) { if (info->del_set.index != IPSET_INVALID_ID) {
index = ip_set_nfnl_get_byindex(par->net, info->del_set.index); index = ip_set_nfnl_get_byindex(par->net, info->del_set.index);
if (index == IPSET_INVALID_ID) { if (index == IPSET_INVALID_ID) {
pr_warning("Cannot find del_set index %u as target\n", pr_warn("Cannot find del_set index %u as target\n",
info->del_set.index); info->del_set.index);
if (info->add_set.index != IPSET_INVALID_ID) if (info->add_set.index != IPSET_INVALID_ID)
ip_set_nfnl_put(par->net, info->add_set.index); ip_set_nfnl_put(par->net, info->add_set.index);
...@@ -248,8 +246,7 @@ set_target_v0_checkentry(const struct xt_tgchk_param *par) ...@@ -248,8 +246,7 @@ set_target_v0_checkentry(const struct xt_tgchk_param *par)
} }
if (info->add_set.u.flags[IPSET_DIM_MAX-1] != 0 || if (info->add_set.u.flags[IPSET_DIM_MAX-1] != 0 ||
info->del_set.u.flags[IPSET_DIM_MAX-1] != 0) { info->del_set.u.flags[IPSET_DIM_MAX-1] != 0) {
pr_warning("Protocol error: SET target dimension " pr_warn("Protocol error: SET target dimension is over the limit!\n");
"is over the limit!\n");
if (info->add_set.index != IPSET_INVALID_ID) if (info->add_set.index != IPSET_INVALID_ID)
ip_set_nfnl_put(par->net, info->add_set.index); ip_set_nfnl_put(par->net, info->add_set.index);
if (info->del_set.index != IPSET_INVALID_ID) if (info->del_set.index != IPSET_INVALID_ID)
...@@ -303,7 +300,7 @@ set_target_v1_checkentry(const struct xt_tgchk_param *par) ...@@ -303,7 +300,7 @@ set_target_v1_checkentry(const struct xt_tgchk_param *par)
if (info->add_set.index != IPSET_INVALID_ID) { if (info->add_set.index != IPSET_INVALID_ID) {
index = ip_set_nfnl_get_byindex(par->net, info->add_set.index); index = ip_set_nfnl_get_byindex(par->net, info->add_set.index);
if (index == IPSET_INVALID_ID) { if (index == IPSET_INVALID_ID) {
pr_warning("Cannot find add_set index %u as target\n", pr_warn("Cannot find add_set index %u as target\n",
info->add_set.index); info->add_set.index);
return -ENOENT; return -ENOENT;
} }
...@@ -312,7 +309,7 @@ set_target_v1_checkentry(const struct xt_tgchk_param *par) ...@@ -312,7 +309,7 @@ set_target_v1_checkentry(const struct xt_tgchk_param *par)
if (info->del_set.index != IPSET_INVALID_ID) { if (info->del_set.index != IPSET_INVALID_ID) {
index = ip_set_nfnl_get_byindex(par->net, info->del_set.index); index = ip_set_nfnl_get_byindex(par->net, info->del_set.index);
if (index == IPSET_INVALID_ID) { if (index == IPSET_INVALID_ID) {
pr_warning("Cannot find del_set index %u as target\n", pr_warn("Cannot find del_set index %u as target\n",
info->del_set.index); info->del_set.index);
if (info->add_set.index != IPSET_INVALID_ID) if (info->add_set.index != IPSET_INVALID_ID)
ip_set_nfnl_put(par->net, info->add_set.index); ip_set_nfnl_put(par->net, info->add_set.index);
...@@ -321,8 +318,7 @@ set_target_v1_checkentry(const struct xt_tgchk_param *par) ...@@ -321,8 +318,7 @@ set_target_v1_checkentry(const struct xt_tgchk_param *par)
} }
if (info->add_set.dim > IPSET_DIM_MAX || if (info->add_set.dim > IPSET_DIM_MAX ||
info->del_set.dim > IPSET_DIM_MAX) { info->del_set.dim > IPSET_DIM_MAX) {
pr_warning("Protocol error: SET target dimension " pr_warn("Protocol error: SET target dimension is over the limit!\n");
"is over the limit!\n");
if (info->add_set.index != IPSET_INVALID_ID) if (info->add_set.index != IPSET_INVALID_ID)
ip_set_nfnl_put(par->net, info->add_set.index); ip_set_nfnl_put(par->net, info->add_set.index);
if (info->del_set.index != IPSET_INVALID_ID) if (info->del_set.index != IPSET_INVALID_ID)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment