]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
q_cake: allow changing to diffserv3
authorKevin Bracey <kevin@bracey.fi>
Thu, 6 Jan 2022 11:16:04 +0000 (13:16 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 12 Jan 2022 23:26:11 +0000 (15:26 -0800)
A diffserv3 option (enum value 0) was never sent to the kernel, so it
was not possible to use "tc qdisc change" to select it.

This also meant that were also relying on the kernel's default being
diffserv3 when adding. If the default were to change, we wouldn't have
been able to request diffserv3 explicitly.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/q_cake.c

index 4cfc1c00264a8fce81579d580dd02d5c16156eaa..c438b765ec56ec2121bc9c63347b1bebcc79c2c3 100644 (file)
@@ -95,7 +95,7 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
        bool overhead_override = false;
        bool overhead_set = false;
        unsigned int interval = 0;
-       unsigned int diffserv = 0;
+       int diffserv = -1;
        unsigned int memlimit = 0;
        unsigned int fwmark = 0;
        unsigned int target = 0;
@@ -356,7 +356,7 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
        if (bandwidth || unlimited)
                addattr_l(n, 1024, TCA_CAKE_BASE_RATE64, &bandwidth,
                          sizeof(bandwidth));
-       if (diffserv)
+       if (diffserv != -1)
                addattr_l(n, 1024, TCA_CAKE_DIFFSERV_MODE, &diffserv,
                          sizeof(diffserv));
        if (atm != -1)