]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
q_cake: properly print memlimit
authorOdin Ugedal <odin@ugedal.com>
Wed, 15 Apr 2020 14:39:35 +0000 (16:39 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 20 Apr 2020 16:33:15 +0000 (09:33 -0700)
Load memlimit so that it will be printed if it isn't set to zero.

Also add a space to properly print it.

Signed-off-by: Odin Ugedal <odin@ugedal.com>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/q_cake.c

index 9ebb270c1622204491c28df15ce74c26d93d8980..bf116e80316ca4f78553fcd6aaf77bf015ef7fee 100644 (file)
@@ -520,6 +520,10 @@ static int cake_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
            RTA_PAYLOAD(tb[TCA_CAKE_RTT]) >= sizeof(__u32)) {
                interval = rta_getattr_u32(tb[TCA_CAKE_RTT]);
        }
+       if (tb[TCA_CAKE_MEMORY] &&
+               RTA_PAYLOAD(tb[TCA_CAKE_MEMORY]) >= sizeof(__u32)) {
+               memlimit = rta_getattr_u32(tb[TCA_CAKE_MEMORY]);
+       }
        if (tb[TCA_CAKE_FWMARK] &&
            RTA_PAYLOAD(tb[TCA_CAKE_FWMARK]) >= sizeof(__u32)) {
                fwmark = rta_getattr_u32(tb[TCA_CAKE_FWMARK]);
@@ -572,7 +576,7 @@ static int cake_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 
        if (memlimit) {
                print_uint(PRINT_JSON, "memlimit", NULL, memlimit);
-               print_string(PRINT_FP, NULL, "memlimit %s",
+               print_string(PRINT_FP, NULL, "memlimit %s ",
                             sprint_size(memlimit, b1));
        }