libiproute: rename invarg(a,b) to invarg_1_to_2(a,b)
invarg(a,b) - "invalid argument", but how a and b enter the message?
invarg_1_to_2(a,b) is somewhat easier to read: "invalid argument 'a' to 'b'"
Audit of usage revealed a number of bad uses, with too long messages.
text data bss dec hex filename
938848 932 17448 957228 e9b2c busybox_old
938788 932 17448 957168 e9af0 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c
index 774a3e2..c3b2109 100644
--- a/networking/libiproute/iprule.c
+++ b/networking/libiproute/iprule.c
@@ -214,7 +214,7 @@
while (*argv) {
key = index_in_substrings(keywords, *argv) + 1;
if (key == 0) /* no match found in keywords array, bail out. */
- invarg(*argv, applet_name);
+ invarg_1_to_2(*argv, applet_name);
if (key == ARG_from) {
inet_prefix dst;
NEXT_ARG();
@@ -239,7 +239,7 @@
uint32_t tos;
NEXT_ARG();
if (rtnl_dsfield_a2n(&tos, *argv))
- invarg(*argv, "TOS");
+ invarg_1_to_2(*argv, "TOS");
req.r.rtm_tos = tos;
} else if (key == ARG_fwmark) {
uint32_t fwmark;
@@ -250,7 +250,7 @@
uint32_t realm;
NEXT_ARG();
if (get_rt_realms(&realm, *argv))
- invarg(*argv, "realms");
+ invarg_1_to_2(*argv, "realms");
addattr32(&req.n, sizeof(req), RTA_FLOW, realm);
} else if (key == ARG_table ||
key == ARG_lookup
@@ -258,7 +258,7 @@
uint32_t tid;
NEXT_ARG();
if (rtnl_rttable_a2n(&tid, *argv))
- invarg(*argv, "table ID");
+ invarg_1_to_2(*argv, "table ID");
req.r.rtm_table = tid;
table_ok = 1;
} else if (key == ARG_dev ||
@@ -281,7 +281,7 @@
if (key == ARG_help)
bb_show_usage();
if (rtnl_rtntype_a2n(&type, *argv))
- invarg(*argv, "type");
+ invarg_1_to_2(*argv, "type");
req.r.rtm_type = type;
}
argv++;
@@ -309,7 +309,7 @@
if (*argv) {
int cmd = index_in_substrings(ip_rule_commands, *argv);
if (cmd < 0)
- invarg(*argv, applet_name);
+ invarg_1_to_2(*argv, applet_name);
argv++;
if (cmd < 2)
return iprule_modify((cmd == 0) ? RTM_NEWRULE : RTM_DELRULE, argv);