bgpd: implement admin distance
Until today the admin distance cannot be configured for any IPv6
routing protocol. This patch implements it for bgp.
Signed-off-by: Maitane Zotes <maz@open.ch>
patchwork #993: http://patchwork.quagga.net/patch/993/
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index d0b9216..4066a9a 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -814,6 +814,14 @@
SET_FLAG (api.message, ZAPI_MESSAGE_METRIC);
api.metric = info->attr->med;
+ distance = ipv6_bgp_distance_apply (p, info, bgp);
+
+ if (distance)
+ {
+ SET_FLAG (api.message, ZAPI_MESSAGE_DISTANCE);
+ api.distance = distance;
+ }
+
if (BGP_DEBUG(zebra, ZEBRA))
{
char buf[2][INET6_ADDRSTRLEN];