]> git.puffer.fish Git - mirror/frr.git/commitdiff
ripd & ripngd: avoid the zero interface metric
authorLu Feng <lu.feng@6wind.com>
Mon, 14 Apr 2014 08:09:29 +0000 (08:09 +0000)
committerDavid Lamparter <equinox@opensourcerouting.org>
Tue, 3 Jun 2014 13:32:11 +0000 (15:32 +0200)
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 <lu.feng@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
ripd/ripd.c
ripngd/ripngd.c

index 55a1a75f1d10e4c58c611e659eb68cef8ed5c0fa..01bd69eca02c951d3d2c5fa7362db35e0e735b56 100644 (file)
@@ -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;
index 8e97c2f8ba0991538cfa9dc5bc3a04c7aaca6f95..318f600ef3ea975b0792ee73d98940645fcac233 100644 (file)
@@ -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;