2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

netdev: Enforce a floor "linux-htb" min-rate

This commit is contained in:
Justin Pettit
2010-10-08 14:18:28 -07:00
parent 015c93a49a
commit da3827b551
2 changed files with 4 additions and 3 deletions

View File

@@ -2415,13 +2415,13 @@ htb_parse_class_details__(struct netdev *netdev,
const char *priority_s = shash_find_data(details, "priority");
int mtu;
/* min-rate */
/* min-rate. Don't allow a min-rate below 1500 bytes/s. */
if (!min_rate_s) {
/* min-rate is required. */
return EINVAL;
}
hc->min_rate = strtoull(min_rate_s, NULL, 10) / 8;
hc->min_rate = MAX(hc->min_rate, 0);
hc->min_rate = MAX(hc->min_rate, 1500);
hc->min_rate = MIN(hc->min_rate, htb->max_rate);
/* max-rate */