bgpd, zebra: Use next hop tracking for connected routes too
Allow next hop tracking to work with connected routes
And cleanup obsolete code in bgp_scan and bgp_import.
Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Edits: Paul Jakma <paul.jakma@hpe.com> Rebase re-ordering conflicts with
NHT route-map, potential errors.
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 4a8b55f..f0e8d12 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -748,6 +748,7 @@
struct stream *s;
struct prefix p;
u_short l = 0;
+ u_char connected;
if (IS_ZEBRA_DEBUG_NHT)
zlog_debug("nexthop_register msg from client %s: length=%d\n",
@@ -757,14 +758,19 @@
while (l < length)
{
+ connected = stream_getc(s);
p.family = stream_getw(s);
p.prefixlen = stream_getc(s);
- l += 3;
+ l += 4;
stream_get(&p.u.prefix, s, PSIZE(p.prefixlen));
l += PSIZE(p.prefixlen);
rnh = zebra_add_rnh(&p, 0);
client->nh_reg_time = quagga_time(NULL);
+
+ if (connected)
+ SET_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED);
+
zebra_add_rnh_client(rnh, client, vrf_id);
}
zebra_evaluate_rnh_table(0, AF_INET);
@@ -789,9 +795,10 @@
while (l < length)
{
+ (void)stream_getc(s);
p.family = stream_getw(s);
p.prefixlen = stream_getc(s);
- l += 3;
+ l += 4;
stream_get(&p.u.prefix, s, PSIZE(p.prefixlen));
l += PSIZE(p.prefixlen);
rnh = zebra_lookup_rnh(&p, 0);