From: Lu Feng Date: Mon, 14 Apr 2014 08:09:29 +0000 (+0000) Subject: ripd & ripngd: avoid the zero interface metric X-Git-Tag: frr-2.0-rc1~1582 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=7b3b98ae3ecdad20cf5cebd2a6532aee17184d95;p=mirror%2Ffrr.git ripd & ripngd: avoid the zero interface metric The interface metric is initialized to 0 in the commit db19c85: zebra: set metric for directly connected routes via netlink to 0 Ripd and ripngd must be aware of it and avoid increase the route metric by 0. Signed-off-by: Feng Lu Signed-off-by: David Lamparter --- diff --git a/ripd/ripd.c b/ripd/ripd.c index 55a1a75f1d..01bd69eca0 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 8e97c2f8ba..318f600ef3 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;