summaryrefslogtreecommitdiffhomepage
path: root/networking/tc.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-10-14 13:21:01 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2015-10-14 13:21:01 +0200
commit0f296a3a56b52842057e5a2bc653621a3a6c7bec (patch)
treec504475cbf18d845698097e6b3b9656e0040d373 /networking/tc.c
parent69934701fd1b18327b3a779cb292a728834b2d0d (diff)
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>
Diffstat (limited to 'networking/tc.c')
-rw-r--r--networking/tc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/networking/tc.c b/networking/tc.c
index 6d1fef993..c84c18a67 100644
--- a/networking/tc.c
+++ b/networking/tc.c
@@ -459,14 +459,14 @@ int tc_main(int argc UNUSED_PARAM, char **argv)
obj = index_in_substrings(objects, *argv++);
- if (obj < OBJ_qdisc)
+ if (obj < 0)
bb_show_usage();
if (!*argv)
cmd = CMD_show; /* list is the default */
else {
cmd = index_in_substrings(commands, *argv);
if (cmd < 0)
- bb_error_msg_and_die(bb_msg_invalid_arg, *argv, applet_name);
+ invarg_1_to_2(*argv, argv[-1]);
argv++;
}
memset(&msg, 0, sizeof(msg));
@@ -489,7 +489,7 @@ int tc_main(int argc UNUSED_PARAM, char **argv)
NEXT_ARG();
/* We don't care about duparg2("qdisc handle",*argv) for now */
if (get_qdisc_handle(&filter_qdisc, *argv))
- invarg(*argv, "qdisc");
+ invarg_1_to_2(*argv, "qdisc");
} else
if (obj != OBJ_qdisc
&& (arg == ARG_root
@@ -499,7 +499,7 @@ int tc_main(int argc UNUSED_PARAM, char **argv)
) {
/* nothing */
} else {
- invarg(*argv, "command");
+ invarg_1_to_2(*argv, "command");
}
NEXT_ARG();
if (arg == ARG_root) {
@@ -513,7 +513,7 @@ int tc_main(int argc UNUSED_PARAM, char **argv)
if (msg.tcm_parent)
duparg(*argv, "parent");
if (get_tc_classid(&handle, *argv))
- invarg(*argv, "parent");
+ invarg_1_to_2(*argv, "parent");
msg.tcm_parent = handle;
if (obj == OBJ_filter)
filter_parent = handle;
@@ -538,7 +538,7 @@ int tc_main(int argc UNUSED_PARAM, char **argv)
if (filter_proto)
duparg(*argv, "protocol");
if (ll_proto_a2n(&tmp, *argv))
- invarg(*argv, "protocol");
+ invarg_1_to_2(*argv, "protocol");
filter_proto = tmp;
}
}