summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Ward <david.ward@ll.mit.edu>2015-05-18 11:35:10 -0400
committerStephen Hemminger <shemming@brocade.com>2015-05-21 14:16:03 -0700
commita77905ef6aeaf85b26c51a62e409a7ccc5128410 (patch)
tree4361279d62251be76535018099999128e15da53b
parentd73e0408e2d1c02d94512c035d568b1530854e23 (diff)
downloadiproute2-a77905ef6aeaf85b26c51a62e409a7ccc5128410.tar.gz
tc: gred: Print usage text if no arguments appear after "gred"
This is more helpful to the user, since the command takes two forms, and the message that would otherwise appear about missing parameters assumes one of those forms. Signed-off-by: David Ward <david.ward@ll.mit.edu>
-rw-r--r--tc/q_gred.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tc/q_gred.c b/tc/q_gred.c
index a3dc722b..65caeee6 100644
--- a/tc/q_gred.c
+++ b/tc/q_gred.c
@@ -213,6 +213,10 @@ static int gred_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct n
argc--; argv++;
}
+ if (!ok) {
+ explain();
+ return -1;
+ }
if (!opt.qth_min || !opt.qth_max || !opt.limit || !avpkt ||
(opt.DP<0)) {
fprintf(stderr, "Required parameter (min, max, limit, "