summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ripd/ripd.c2
-rw-r--r--ripngd/ripngd.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/ripd/ripd.c b/ripd/ripd.c
index 55a1a75f..01bd69ec 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -433,7 +433,7 @@ rip_rte_process (struct rte *rte, struct sockaddr_in *from,
/* If offset-list does not modify the metric use interface's
metric. */
if (!ret)
- rte->metric += ifp->metric;
+ rte->metric += ifp->metric ? ifp->metric : 1;
if (rte->metric > RIP_METRIC_INFINITY)
rte->metric = RIP_METRIC_INFINITY;
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index 8e97c2f8..318f600e 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -717,7 +717,7 @@ ripng_route_process (struct rte *rte, struct sockaddr_in6 *from,
/* If offset-list does not modify the metric use interface's
* one. */
if (! ret)
- rte->metric += ifp->metric;
+ rte->metric += ifp->metric ? ifp->metric : 1;
if (rte->metric > RIPNG_METRIC_INFINITY)
rte->metric = RIPNG_METRIC_INFINITY;