From: David Ward Date: Mon, 18 May 2015 15:35:10 +0000 (-0400) Subject: tc: gred: Print usage text if no arguments appear after "gred" X-Git-Tag: v4.1.0~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a77905ef6aeaf85b26c51a62e409a7ccc5128410;p=thirdparty%2Fiproute2.git 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 --- diff --git a/tc/q_gred.c b/tc/q_gred.c index a3dc722b6..65caeee6f 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, "