summaryrefslogtreecommitdiff
path: root/zebra/zebra_mpls.h
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_mpls.h
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_mpls.h')
-rw-r--r--zebra/zebra_mpls.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h
index c8df8670f4..51279798a4 100644
--- a/zebra/zebra_mpls.h
+++ b/zebra/zebra_mpls.h
@@ -408,10 +408,16 @@ void zebra_mpls_vty_init(void);
*/
static inline u_char lsp_distance(enum lsp_types_t type)
{
- if (type == ZEBRA_LSP_STATIC)
+ switch (type) {
+ case ZEBRA_LSP_STATIC:
return (route_distance(ZEBRA_ROUTE_STATIC));
-
- return 150;
+ case ZEBRA_LSP_LDP:
+ return (route_distance(ZEBRA_ROUTE_LDP));
+ case ZEBRA_LSP_BGP:
+ return (route_distance(ZEBRA_ROUTE_BGP));
+ default:
+ return 150;
+ }
}
/*