]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/commitdiff
iproute: show metrics as an unsigned value
authorJorge Boncompte [DTI2] <jorge@dti2.net>
Tue, 10 Apr 2012 15:23:59 +0000 (08:23 -0700)
committerStephen Hemminger <shemminger@vyatta.com>
Tue, 10 Apr 2012 15:23:59 +0000 (08:23 -0700)
Avoids showing negative metrics.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
ip/iproute.c

index c97f9794840ffb098eefcc5e03e6d35d2f8586c4..2d15c019a8bba160bc60e69c9f70c9918cbe49d3 100644 (file)
@@ -404,7 +404,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
                                    abuf, sizeof(abuf)));
        }
        if (tb[RTA_PRIORITY])
-               fprintf(fp, " metric %d ", *(__u32*)RTA_DATA(tb[RTA_PRIORITY]));
+               fprintf(fp, " metric %u ", *(__u32*)RTA_DATA(tb[RTA_PRIORITY]));
        if (r->rtm_flags & RTNH_F_DEAD)
                fprintf(fp, "dead ");
        if (r->rtm_flags & RTNH_F_ONLINK)