From a836c882df2cb28d327fc93c5d30b968ca3ee1b0 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Tue, 13 Jan 2015 10:52:56 +0300 Subject: shaper: fixed parsing ecn/noecn for fq_codel --- accel-pppd/shaper/leaf_qdisc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/accel-pppd/shaper/leaf_qdisc.c b/accel-pppd/shaper/leaf_qdisc.c index d6b29583..ef558533 100644 --- a/accel-pppd/shaper/leaf_qdisc.c +++ b/accel-pppd/shaper/leaf_qdisc.c @@ -167,8 +167,15 @@ static int parse_fq_codel(char *str) while (1) { for (ptr1 = str + 1; *ptr1 && *ptr1 != ' '; ptr1++); - if (!*ptr1) - return -1; + if (!*ptr1) { + if (strcmp(str, "ecn") == 0) + conf_lq_arg6 = 1; + else if (strcmp(str, "noecn") == 0) + conf_lq_arg6 = 0; + else + return -1; + break; + } *ptr1 = 0; @@ -199,10 +206,6 @@ static int parse_fq_codel(char *str) } else if (strcmp(str, "interval") == 0) { if (parse_time(ptr1, &conf_lq_arg5)) return -1; - } else if (strcmp(str, "ecn") == 0) { - conf_lq_arg6 = 1; - } else if (strcmp(str, "noecn") == 0) { - conf_lq_arg6 = 0; } else return -1; -- cgit v1.2.3