]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: gred: Print usage text if no arguments appear after "gred"
authorDavid Ward <david.ward@ll.mit.edu>
Mon, 18 May 2015 15:35:10 +0000 (11:35 -0400)
committerStephen Hemminger <shemming@brocade.com>
Thu, 21 May 2015 21:16:03 +0000 (14:16 -0700)
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>
tc/q_gred.c

index a3dc722b60ce3f0a25ed4f0c903e208e26306bc4..65caeee6fb0587316fd8b5a86ea8ce68c12723ed 100644 (file)
@@ -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, "