}
static int choke_parse_opt(struct qdisc_util *qu, int argc, char **argv,
- struct nlmsghdr *n)
+ struct nlmsghdr *n, const char *dev)
{
struct tc_red_qopt opt = {};
unsigned int burst = 0;
}
} else if (strcmp(*argv, "bandwidth") == 0) {
NEXT_ARG();
- if (get_rate(&rate, *argv)) {
+ if (strchr(*argv, '%')) {
+ if (get_percent_rate(&rate, *argv, dev)) {
+ fprintf(stderr, "Illegal \"bandwidth\"\n");
+ return -1;
+ }
+ } else if (get_rate(&rate, *argv)) {
fprintf(stderr, "Illegal \"bandwidth\"\n");
return -1;
}