mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2025-10-04 19:29:30 +00:00
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:e9e78b0db0
is the first bad commit commite9e78b0db0
Author: Stephen Hemminger <stephen@networkplumber.org> Date: Mon Aug 26 08:41:19 2013 -0700 tc: allow qdisc without options
This commit is contained in:
parent
1253a10a63
commit
0a502b21e3
@ -137,15 +137,16 @@ static int tc_qdisc_modify(int cmd, unsigned flags, int argc, char **argv)
|
|||||||
if (est.ewma_log)
|
if (est.ewma_log)
|
||||||
addattr_l(&req.n, sizeof(req), TCA_RATE, &est, sizeof(est));
|
addattr_l(&req.n, sizeof(req), TCA_RATE, &est, sizeof(est));
|
||||||
|
|
||||||
if (argc) {
|
if (q) {
|
||||||
if (q) {
|
if (q->parse_qopt) {
|
||||||
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))
|
if (q->parse_qopt(q, argc, argv, &req.n))
|
||||||
return 1;
|
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)
|
if (matches(*argv, "help") == 0)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user