From be61c4eb59b8df1aab496176d87bb2e1763f185e Mon Sep 17 00:00:00 2001 From: hasso Date: Sat, 27 Aug 2005 06:05:47 +0000 Subject: * 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. --- zebra/zebra_rib.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'zebra/zebra_rib.c') 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; -- cgit v1.2.1