* 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.
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index da6a3a8..6d947c8 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1748,7 +1748,8 @@
 
 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 @@
   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 @@
   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;