From: Donald Sharp Date: Fri, 9 Dec 2016 17:05:29 +0000 (-0500) Subject: bgpd, zebra: Pass distance as part of the ZEBRA_NEXTHOP_UPDATE X-Git-Tag: frr-3.0-branchpoint~60^2~12 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=d14b95ce968a44a8278745fc23ac9f37e98629a1;p=matthieu%2Ffrr.git bgpd, zebra: Pass distance as part of the ZEBRA_NEXTHOP_UPDATE When zebra calls routing protocols back with either ZEBRA_NEXTHOP_UPDATE or ZEBRA_IMPORT_CHECK_UPDATE pass the distance value too. This is to set us up for nht for pim as that it needs the distance sometimes too. Signed-off-by: Donald Sharp --- diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index 057e2ace76..aa752280cf 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -377,6 +377,7 @@ bgp_parse_nexthop_update (int command, vrf_id_t vrf_id) bgp_unlock_node (rn); bnc->last_update = bgp_clock(); bnc->change_flags = 0; + stream_getc (s); // Distance but not currently used metric = stream_getl (s); nexthop_num = stream_getc (s); diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index 182cfe552d..b180930a0a 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -878,6 +878,7 @@ send_client (struct rnh *rnh, struct zserv *client, rnh_type_t type, vrf_id_t vr } if (rib) { + stream_putc (s, rib->distance); stream_putl (s, rib->metric); num = 0; nump = stream_get_endp(s); @@ -917,8 +918,9 @@ send_client (struct rnh *rnh, struct zserv *client, rnh_type_t type, vrf_id_t vr } else { - stream_putl (s, 0); - stream_putc (s, 0); + stream_putc (s, 0); // distance + stream_putl (s, 0); // metric + stream_putc (s, 0); // nexthops } stream_putw_at (s, 0, stream_get_endp (s));