diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2013-10-27 12:26:47 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2013-10-27 12:26:47 -0700 |
commit | 0a502b21e30be835dcad8d9c6023a41da8709eb1 (patch) | |
tree | 74c77038ca296bb7c96d05ccafa874e45d9f4057 /tc/tc_qdisc.c | |
parent | 1253a10a63e417c5a7774c127aea1a3b0dd09e88 (diff) | |
download | platform_external_iproute2-0a502b21e30be835dcad8d9c6023a41da8709eb1.tar.gz platform_external_iproute2-0a502b21e30be835dcad8d9c6023a41da8709eb1.tar.bz2 platform_external_iproute2-0a502b21e30be835dcad8d9c6023a41da8709eb1.zip |
Fix handling of qdis without options
Some qdisc like htb want the parse_qopt to be called even if no options
present. Fixes regression caused by:
e9e78b0db0e023035e346ba67de838be851eb665 is the first bad commit
commit e9e78b0db0e023035e346ba67de838be851eb665
Author: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon Aug 26 08:41:19 2013 -0700
tc: allow qdisc without options
Diffstat (limited to 'tc/tc_qdisc.c')
-rw-r--r-- | tc/tc_qdisc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c index 3002a56c..e3048580 100644 --- a/tc/tc_qdisc.c +++ b/tc/tc_qdisc.c @@ -137,15 +137,16 @@ 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 (argc) { - if (q) { - if (!q->parse_qopt) { - fprintf(stderr, "qdisc '%s' does not support option parsing\n", k); - return -1; - } + if (q) { + if (q->parse_qopt) { if (q->parse_qopt(q, argc, argv, &req.n)) return 1; - } else { + } else if (argc) { + fprintf(stderr, "qdisc '%s' does not support option parsing\n", k); + return -1; + } + } else { + if (argc) { if (matches(*argv, "help") == 0) usage(); |