Commit f1675d61 authored by Dan Kenigsberg's avatar Dan Kenigsberg Committed by Stephen Hemminger

utils: invarg: msg precedes the faulty arg

fix all call which reversed the arg order.
Signed-off-by: default avatarDan Kenigsberg <danken@redhat.com>
parent 90698170
...@@ -188,7 +188,7 @@ int main(int argc, char **argv) ...@@ -188,7 +188,7 @@ int main(int argc, char **argv)
else if (strcmp(argv[1], "help") == 0) else if (strcmp(argv[1], "help") == 0)
usage(); usage();
else else
invarg(argv[1], "invalid protocol family"); invarg("invalid protocol family", argv[1]);
} else if (strcmp(opt, "-4") == 0) { } else if (strcmp(opt, "-4") == 0) {
preferred_family = AF_INET; preferred_family = AF_INET;
} else if (strcmp(opt, "-6") == 0) { } else if (strcmp(opt, "-6") == 0) {
......
...@@ -1147,7 +1147,7 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv) ...@@ -1147,7 +1147,7 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv)
unsigned scope = 0; unsigned scope = 0;
NEXT_ARG(); NEXT_ARG();
if (rtnl_rtscope_a2n(&scope, *argv)) if (rtnl_rtscope_a2n(&scope, *argv))
invarg(*argv, "invalid scope value."); invarg("invalid scope value.", *argv);
req.ifa.ifa_scope = scope; req.ifa.ifa_scope = scope;
scoped = 1; scoped = 1;
} else if (strcmp(*argv, "dev") == 0) { } else if (strcmp(*argv, "dev") == 0) {
......
...@@ -74,7 +74,7 @@ int tc_class_modify(int cmd, unsigned flags, int argc, char **argv) ...@@ -74,7 +74,7 @@ int tc_class_modify(int cmd, unsigned flags, int argc, char **argv)
if (req.t.tcm_handle) if (req.t.tcm_handle)
duparg("classid", *argv); duparg("classid", *argv);
if (get_tc_classid(&handle, *argv)) if (get_tc_classid(&handle, *argv))
invarg(*argv, "invalid class ID"); invarg("invalid class ID", *argv);
req.t.tcm_handle = handle; req.t.tcm_handle = handle;
} else if (strcmp(*argv, "handle") == 0) { } else if (strcmp(*argv, "handle") == 0) {
fprintf(stderr, "Error: try \"classid\" instead of \"handle\"\n"); fprintf(stderr, "Error: try \"classid\" instead of \"handle\"\n");
...@@ -91,7 +91,7 @@ int tc_class_modify(int cmd, unsigned flags, int argc, char **argv) ...@@ -91,7 +91,7 @@ int tc_class_modify(int cmd, unsigned flags, int argc, char **argv)
if (req.t.tcm_parent) if (req.t.tcm_parent)
duparg("parent", *argv); duparg("parent", *argv);
if (get_tc_classid(&handle, *argv)) if (get_tc_classid(&handle, *argv))
invarg(*argv, "invalid parent ID"); invarg("invalid parent ID", *argv);
req.t.tcm_parent = handle; req.t.tcm_parent = handle;
} else if (matches(*argv, "estimator") == 0) { } else if (matches(*argv, "estimator") == 0) {
if (parse_estimator(&argc, &argv, &est)) if (parse_estimator(&argc, &argv, &est))
...@@ -252,13 +252,13 @@ int tc_class_list(int argc, char **argv) ...@@ -252,13 +252,13 @@ int tc_class_list(int argc, char **argv)
if (filter_qdisc) if (filter_qdisc)
duparg("qdisc", *argv); duparg("qdisc", *argv);
if (get_qdisc_handle(&filter_qdisc, *argv)) if (get_qdisc_handle(&filter_qdisc, *argv))
invarg(*argv, "invalid qdisc ID"); invarg("invalid qdisc ID", *argv);
} else if (strcmp(*argv, "classid") == 0) { } else if (strcmp(*argv, "classid") == 0) {
NEXT_ARG(); NEXT_ARG();
if (filter_classid) if (filter_classid)
duparg("classid", *argv); duparg("classid", *argv);
if (get_tc_classid(&filter_classid, *argv)) if (get_tc_classid(&filter_classid, *argv))
invarg(*argv, "invalid class ID"); invarg("invalid class ID", *argv);
} else if (strcmp(*argv, "root") == 0) { } else if (strcmp(*argv, "root") == 0) {
if (t.tcm_parent) { if (t.tcm_parent) {
fprintf(stderr, "Error: \"root\" is duplicate parent ID\n"); fprintf(stderr, "Error: \"root\" is duplicate parent ID\n");
...@@ -271,7 +271,7 @@ int tc_class_list(int argc, char **argv) ...@@ -271,7 +271,7 @@ int tc_class_list(int argc, char **argv)
duparg("parent", *argv); duparg("parent", *argv);
NEXT_ARG(); NEXT_ARG();
if (get_tc_classid(&handle, *argv)) if (get_tc_classid(&handle, *argv))
invarg(*argv, "invalid parent ID"); invarg("invalid parent ID", *argv);
t.tcm_parent = handle; t.tcm_parent = handle;
} else if (matches(*argv, "help") == 0) { } else if (matches(*argv, "help") == 0) {
usage(); usage();
......
...@@ -93,7 +93,7 @@ int tc_filter_modify(int cmd, unsigned flags, int argc, char **argv) ...@@ -93,7 +93,7 @@ int tc_filter_modify(int cmd, unsigned flags, int argc, char **argv)
if (req.t.tcm_parent) if (req.t.tcm_parent)
duparg("parent", *argv); duparg("parent", *argv);
if (get_tc_classid(&handle, *argv)) if (get_tc_classid(&handle, *argv))
invarg(*argv, "Invalid parent ID"); invarg("Invalid parent ID", *argv);
req.t.tcm_parent = handle; req.t.tcm_parent = handle;
} else if (strcmp(*argv, "handle") == 0) { } else if (strcmp(*argv, "handle") == 0) {
NEXT_ARG(); NEXT_ARG();
...@@ -106,14 +106,14 @@ int tc_filter_modify(int cmd, unsigned flags, int argc, char **argv) ...@@ -106,14 +106,14 @@ int tc_filter_modify(int cmd, unsigned flags, int argc, char **argv)
if (prio) if (prio)
duparg("priority", *argv); duparg("priority", *argv);
if (get_u32(&prio, *argv, 0) || prio > 0xFFFF) if (get_u32(&prio, *argv, 0) || prio > 0xFFFF)
invarg(*argv, "invalid priority value"); invarg("invalid priority value", *argv);
} else if (matches(*argv, "protocol") == 0) { } else if (matches(*argv, "protocol") == 0) {
__u16 id; __u16 id;
NEXT_ARG(); NEXT_ARG();
if (protocol_set) if (protocol_set)
duparg("protocol", *argv); duparg("protocol", *argv);
if (ll_proto_a2n(&id, *argv)) if (ll_proto_a2n(&id, *argv))
invarg(*argv, "invalid protocol"); invarg("invalid protocol", *argv);
protocol = id; protocol = id;
protocol_set = 1; protocol_set = 1;
} else if (matches(*argv, "estimator") == 0) { } else if (matches(*argv, "estimator") == 0) {
...@@ -290,7 +290,7 @@ int tc_filter_list(int argc, char **argv) ...@@ -290,7 +290,7 @@ int tc_filter_list(int argc, char **argv)
if (t.tcm_parent) if (t.tcm_parent)
duparg("parent", *argv); duparg("parent", *argv);
if (get_tc_classid(&handle, *argv)) if (get_tc_classid(&handle, *argv))
invarg(*argv, "invalid parent ID"); invarg("invalid parent ID", *argv);
filter_parent = t.tcm_parent = handle; filter_parent = t.tcm_parent = handle;
} else if (strcmp(*argv, "handle") == 0) { } else if (strcmp(*argv, "handle") == 0) {
NEXT_ARG(); NEXT_ARG();
...@@ -303,7 +303,7 @@ int tc_filter_list(int argc, char **argv) ...@@ -303,7 +303,7 @@ int tc_filter_list(int argc, char **argv)
if (prio) if (prio)
duparg("priority", *argv); duparg("priority", *argv);
if (get_u32(&prio, *argv, 0)) if (get_u32(&prio, *argv, 0))
invarg(*argv, "invalid preference"); invarg("invalid preference", *argv);
filter_prio = prio; filter_prio = prio;
} else if (matches(*argv, "protocol") == 0) { } else if (matches(*argv, "protocol") == 0) {
__u16 res; __u16 res;
...@@ -311,7 +311,7 @@ int tc_filter_list(int argc, char **argv) ...@@ -311,7 +311,7 @@ int tc_filter_list(int argc, char **argv)
if (protocol) if (protocol)
duparg("protocol", *argv); duparg("protocol", *argv);
if (ll_proto_a2n(&res, *argv)) if (ll_proto_a2n(&res, *argv))
invarg(*argv, "invalid protocol"); invarg("invalid protocol", *argv);
protocol = res; protocol = res;
filter_protocol = protocol; filter_protocol = protocol;
} else if (matches(*argv, "help") == 0) { } else if (matches(*argv, "help") == 0) {
......
...@@ -83,7 +83,7 @@ int tc_qdisc_modify(int cmd, unsigned flags, int argc, char **argv) ...@@ -83,7 +83,7 @@ int tc_qdisc_modify(int cmd, unsigned flags, int argc, char **argv)
duparg("handle", *argv); duparg("handle", *argv);
NEXT_ARG(); NEXT_ARG();
if (get_qdisc_handle(&handle, *argv)) if (get_qdisc_handle(&handle, *argv))
invarg(*argv, "invalid qdisc ID"); invarg("invalid qdisc ID", *argv);
req.t.tcm_handle = handle; req.t.tcm_handle = handle;
} else if (strcmp(*argv, "root") == 0) { } else if (strcmp(*argv, "root") == 0) {
if (req.t.tcm_parent) { if (req.t.tcm_parent) {
...@@ -111,7 +111,7 @@ int tc_qdisc_modify(int cmd, unsigned flags, int argc, char **argv) ...@@ -111,7 +111,7 @@ int tc_qdisc_modify(int cmd, unsigned flags, int argc, char **argv)
if (req.t.tcm_parent) if (req.t.tcm_parent)
duparg("parent", *argv); duparg("parent", *argv);
if (get_tc_classid(&handle, *argv)) if (get_tc_classid(&handle, *argv))
invarg(*argv, "invalid parent ID"); invarg("invalid parent ID", *argv);
req.t.tcm_parent = handle; req.t.tcm_parent = handle;
} else if (matches(*argv, "estimator") == 0) { } else if (matches(*argv, "estimator") == 0) {
if (parse_estimator(&argc, &argv, &est)) if (parse_estimator(&argc, &argv, &est))
......
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