summaryrefslogtreecommitdiffstats
path: root/ripd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-09-05 19:17:47 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-09-05 19:17:47 +0200
commit3679c9fa30bfa6a2b3caa6b2afcd3571dc246f47 (patch)
treebdabede30f3fe31981673beb8a11a17e1283dad6 /ripd
parentMerge pull request #1093 from opensourcerouting/static_blackhole_display (diff)
downloadfrr-3679c9fa30bfa6a2b3caa6b2afcd3571dc246f47.tar.xz
frr-3679c9fa30bfa6a2b3caa6b2afcd3571dc246f47.zip
ripd: Fix warning about metric value less than 0
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>
Diffstat (limited to 'ripd')
-rw-r--r--ripd/rip_routemap.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ripd/rip_routemap.c b/ripd/rip_routemap.c
index 7d39023b3..ad9f8cf80 100644
--- a/ripd/rip_routemap.c
+++ b/ripd/rip_routemap.c
@@ -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) {