tc: allow qdisc without options

Pfifo_fast needs no options. So don't force it to have parsing code.
This commit is contained in:
Stephen Hemminger 2013-08-26 08:41:19 -07:00
parent 488c41d216
commit e9e78b0db0
1 changed files with 9 additions and 9 deletions

View File

@ -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();