[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1384419714-24364-3-git-send-email-yangyingliang@huawei.com>
Date: Thu, 14 Nov 2013 17:01:53 +0800
From: Yang Yingliang <yangyingliang@...wei.com>
To: <davem@...emloft.net>, <netdev@...r.kernel.org>
CC: <eric.dumazet@...il.com>
Subject: [PATCH 2/3] net: sched: htb: fix condition of failure when rate is 0
When rate32 is 0, it doesn't means wrong.
Because htb support 64bit rates now, it
could use rate64.
So change the condition, when rate32 and
rate64 are both 0, it goes to failure.
Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
---
net/sched/sch_htb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 0e1e38b..f983803 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1357,7 +1357,8 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
parent = parentid == TC_H_ROOT ? NULL : htb_find(parentid, sch);
hopt = nla_data(tb[TCA_HTB_PARMS]);
- if (!hopt->rate.rate || !hopt->ceil.rate)
+ if ((!hopt->rate.rate && !tb[TCA_HTB_RATE64]) ||
+ (!hopt->ceil.rate && !tb[TCA_HTB_CEIL64]))
goto failure;
/* Keeping backward compatible with rate_table based iproute2 tc */
--
1.7.12
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists