naccyde / rpms / iproute

Forked from rpms/iproute 9 months ago
Clone

Blame SOURCES/iproute2-3.10.0-tc-fix-for-qdiscs-without-options.patch

a4b897
From f2794eafcfaa6dacb1bdcf5cfc11bf9d173cad28 Mon Sep 17 00:00:00 2001
a4b897
From: Stephen Hemminger <stephen@networkplumber.org>
a4b897
Date: Mon, 26 Aug 2013 08:41:19 -0700
a4b897
Subject: [PATCH] tc: fix for qdiscs without options
a4b897
a4b897
This is a combination of 2 commits which fix tc for adding a qdisc which does
a4b897
not support options, like e.g. pfifo_fast. A simple test-case is:
a4b897
a4b897
tc qdisc replace dev eth0 root pfifo_fast
a4b897
a4b897
Without this patch applied, the above command fails with the following message:
a4b897
a4b897
qdisc 'pfifo_fast' does not support option parsing
a4b897
a4b897
commit e9e78b0db0e023035e346ba67de838be851eb665
a4b897
Author: Stephen Hemminger <stephen@networkplumber.org>
a4b897
Date:   Mon Aug 26 08:41:19 2013 -0700
a4b897
a4b897
    tc: allow qdisc without options
a4b897
a4b897
    Pfifo_fast needs no options. So don't force it to have parsing code.
a4b897
a4b897
commit 0a502b21e30be835dcad8d9c6023a41da8709eb1
a4b897
Author: Stephen Hemminger <stephen@networkplumber.org>
a4b897
Date:   Sun Oct 27 12:26:47 2013 -0700
a4b897
a4b897
    Fix handling of qdis without options
a4b897
a4b897
    Some qdisc like htb want the parse_qopt to be called even if no options
a4b897
    present. Fixes regression caused by:
a4b897
a4b897
    e9e78b0db0e023035e346ba67de838be851eb665 is the first bad commit
a4b897
    commit e9e78b0db0e023035e346ba67de838be851eb665
a4b897
    Author: Stephen Hemminger <stephen@networkplumber.org>
a4b897
    Date:   Mon Aug 26 08:41:19 2013 -0700
a4b897
a4b897
        tc: allow qdisc without options
a4b897
---
a4b897
 tc/tc_qdisc.c | 7 ++++---
a4b897
 1 file changed, 4 insertions(+), 3 deletions(-)
a4b897
a4b897
diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c
a4b897
index f3bf5b5..e304858 100644
a4b897
--- a/tc/tc_qdisc.c
a4b897
+++ b/tc/tc_qdisc.c
a4b897
@@ -138,12 +138,13 @@ static int tc_qdisc_modify(int cmd, unsigned flags, int argc, char **argv)
a4b897
 		addattr_l(&req.n, sizeof(req), TCA_RATE, &est, sizeof(est));
a4b897
 
a4b897
 	if (q) {
a4b897
-		if (!q->parse_qopt) {
a4b897
+		if (q->parse_qopt) {
a4b897
+			if (q->parse_qopt(q, argc, argv, &req.n))
a4b897
+				return 1;
a4b897
+		} else if (argc) {
a4b897
 			fprintf(stderr, "qdisc '%s' does not support option parsing\n", k);
a4b897
 			return -1;
a4b897
 		}
a4b897
-		if (q->parse_qopt(q, argc, argv, &req.n))
a4b897
-			return 1;
a4b897
 	} else {
a4b897
 		if (argc) {
a4b897
 			if (matches(*argv, "help") == 0)
a4b897
-- 
a4b897
1.8.3.1
a4b897