summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-09-11 22:51:40 -0300
committerRenato Westphal <renato@opensourcerouting.org>2017-09-12 11:02:25 -0300
commit0492eea08e5708b6931b0264d9731b532e00aade (patch)
treea0ea2a5776d2de193a10a155841a644a5b1a5599 /zebra/zebra_rib.c
parentc710b277cfde65fab8ae071fd80992e836bff7f2 (diff)
zebra: fix administrative distance issues
* Reuse route_distance() on rib_add_multipath() and on rib_add(); * Set the admin distance of LDP and BGP MPLS LSPs. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index e0c92801ce..959ffdce8a 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -2233,7 +2233,7 @@ int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
/* Set default distance by route type. */
if (re->distance == 0) {
- re->distance = route_info[re->type].distance;
+ re->distance = route_distance(re->type);
/* iBGP distance is 200. */
if (re->type == ZEBRA_ROUTE_BGP
@@ -2450,10 +2450,7 @@ int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type, u_short instance,
/* Set default distance by route type. */
if (distance == 0) {
- if ((unsigned)type >= array_size(route_info))
- distance = 150;
- else
- distance = route_info[type].distance;
+ distance = route_distance(type);
/* iBGP distance is 200. */
if (type == ZEBRA_ROUTE_BGP