diff options
author | Tan Tee Min <tee.min.tan@linux.intel.com> | 2022-12-02 14:25:42 +0800 |
---|---|---|
committer | David Ahern <dsahern@kernel.org> | 2022-12-02 08:53:13 -0700 |
commit | 43aa9d9ce7f89fe3f14a3589c9b05e513dd3073c (patch) | |
tree | 591f5fe80802c9eadca0e93c4127974d87c21704 /tc | |
parent | 2ed09c3bf8aca185b2f3eb369ae435503f9b9826 (diff) | |
download | iproute2-43aa9d9ce7f89fe3f14a3589c9b05e513dd3073c.tar.gz |
taprio: fix wrong for loop condition in add_tc_entries()
The for loop in add_tc_entries() mistakenly included the last entry
index+1. Fix it to correctly loop the max_sdu entry between tc=0 and
num_max_sdu_entries-1.
Fixes: b10a6509c195 ("taprio: support dumping and setting per-tc max SDU")
Signed-off-by: Tan Tee Min <tee.min.tan@linux.intel.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
Diffstat (limited to 'tc')
-rw-r--r-- | tc/q_taprio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tc/q_taprio.c b/tc/q_taprio.c index ded385ca..a7c01ae0 100644 --- a/tc/q_taprio.c +++ b/tc/q_taprio.c @@ -157,7 +157,7 @@ static void add_tc_entries(struct nlmsghdr *n, __u32 max_sdu[TC_QOPT_MAX_QUEUE], struct rtattr *l; __u32 tc; - for (tc = 0; tc <= num_max_sdu_entries; tc++) { + for (tc = 0; tc < num_max_sdu_entries; tc++) { l = addattr_nest(n, 1024, TCA_TAPRIO_ATTR_TC_ENTRY | NLA_F_NESTED); addattr_l(n, 1024, TCA_TAPRIO_TC_ENTRY_INDEX, &tc, sizeof(tc)); |