summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorhasso <hasso>2005-08-27 06:05:47 +0000
committerhasso <hasso>2005-08-27 06:05:47 +0000
commitbe61c4eb59b8df1aab496176d87bb2e1763f185e (patch)
tree063e8baa7cd4a863e72d246d7c14f14842cbb604 /zebra/zebra_rib.c
parentb7395791a31f7b734094d032998ab632136f36f1 (diff)
* zebra_rib.c, rib.h: Add distance and metric arguments to the
rib_add_ipv6() function so that IPv6 routes in RIB can have correct metric. No IPv6 routing daemon uses distance yet though. * zserv.c, connected.c, kernel_socket.c, rt_netlink.c, rtread_proc.c,zserv.c: Pass metric and distance info to the rib_add_ipv6(). Forwardport from stable branch.
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;