summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index da6a3a8e..6d947c85 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1748,7 +1748,8 @@ rib_bogus_ipv6 (int type, struct prefix_ipv6 *p,
int
rib_add_ipv6 (int type, int flags, struct prefix_ipv6 *p,
- struct in6_addr *gate, unsigned int ifindex, u_int32_t vrf_id)
+ struct in6_addr *gate, unsigned int ifindex, u_int32_t vrf_id,
+ u_int32_t metric, u_char distance)
{
struct rib *rib;
struct rib *same = NULL;
@@ -1756,9 +1757,6 @@ rib_add_ipv6 (int type, int flags, struct prefix_ipv6 *p,
struct route_node *rn;
struct nexthop *nexthop;
- int distance;
- u_int32_t metric = 0;
-
/* Lookup table. */
table = vrf_table (AFI_IP6, SAFI_UNICAST, 0);
if (! table)
@@ -1768,7 +1766,8 @@ rib_add_ipv6 (int type, int flags, struct prefix_ipv6 *p,
apply_mask_ipv6 (p);
/* Set default distance by route type. */
- distance = route_info[type].distance;
+ if (!distance)
+ distance = route_info[type].distance;
if (type == ZEBRA_ROUTE_BGP && CHECK_FLAG (flags, ZEBRA_FLAG_IBGP))
distance = 200;