]> git.puffer.fish Git - mirror/frr.git/commitdiff
ripd: Fix warning about metric value less than 0 1108/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 5 Sep 2017 17:17:47 +0000 (13:17 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 5 Sep 2017 17:17:47 +0000 (13:17 -0400)
RIP is testing to ensure that the metric returned
isn't negative.  We should be looking at the returned
value from the cli strtol.

If we get a metric value that is less than zero that
means that we shouldn't use this value in RIP currently.
So signify that by returning mod here.

Fixes: #1107
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
ripd/rip_routemap.c

index 7d39023b38df0ce410723619e5cd6244e9e781af..ad9f8cf80bbb49120c3b889ffb3c179b7ae0f5d1 100644 (file)
@@ -421,8 +421,7 @@ static void *route_set_metric_compile(const char *arg)
        /* Convert string to integer. */
        metric = strtol(pnt, &endptr, 10);
 
-       if (*endptr != '\0' || mod->metric < 0) {
-               metric = 0;
+       if (*endptr != '\0' || metric < 0) {
                return mod;
        }
        if (metric > RIP_METRIC_INFINITY) {