]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd, zebra: Pass distance as part of the ZEBRA_NEXTHOP_UPDATE
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 9 Dec 2016 17:05:29 +0000 (12:05 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 30 Jan 2017 16:48:35 +0000 (11:48 -0500)
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 <sharpd@cumulusnetworks.com>
bgpd/bgp_nht.c
zebra/zebra_rnh.c

index 057e2ace7663b2fff73ba822a5918f4a39419920..aa752280cf0db11a9a3cc9d9380e9bb4c6e1c36a 100644 (file)
@@ -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);
 
index 182cfe552d525ae549e36f46c61b23d3eaade56a..b180930a0a2560f83feab8f5b42094d2c9162452 100644 (file)
@@ -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));