diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2013-08-26 08:41:19 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2013-08-26 08:41:19 -0700 |
commit | e9e78b0db0e023035e346ba67de838be851eb665 (patch) | |
tree | 548c05b55d578cbe3644ec933658120d5acd6186 | |
parent | 488c41d21678744ea56332333853ca4ab0827ac9 (diff) |
tc: allow qdisc without options
Pfifo_fast needs no options. So don't force it to have parsing code.
-rw-r--r-- | tc/tc_qdisc.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c index f3bf5b57..3002a56c 100644 --- a/tc/tc_qdisc.c +++ b/tc/tc_qdisc.c @@ -137,15 +137,15 @@ static int tc_qdisc_modify(int cmd, unsigned flags, int argc, char **argv) if (est.ewma_log) addattr_l(&req.n, sizeof(req), TCA_RATE, &est, sizeof(est)); - if (q) { - if (!q->parse_qopt) { - fprintf(stderr, "qdisc '%s' does not support option parsing\n", k); - return -1; - } - if (q->parse_qopt(q, argc, argv, &req.n)) - return 1; - } else { - if (argc) { + if (argc) { + if (q) { + if (!q->parse_qopt) { + fprintf(stderr, "qdisc '%s' does not support option parsing\n", k); + return -1; + } + if (q->parse_qopt(q, argc, argv, &req.n)) + return 1; + } else { if (matches(*argv, "help") == 0) usage(); |