if (CHECK_FLAG(bnc->flags,
BGP_NEXTHOP_CONNECTED))
vty_out(vty, " Must be Connected\n");
- }
+ if (!CHECK_FLAG(bnc->flags,
+ BGP_NEXTHOP_REGISTERED))
+ vty_out(vty, " Is not Registered\n");
+ }
tbuf = time(NULL) - (bgp_clock() - bnc->last_update);
vty_out(vty, " Last update: %s", ctime(&tbuf));
vty_out(vty, "\n");
UNSET_FLAG(bnc->flags, BGP_NEXTHOP_VALID);
}
if (bgp_route->inst_type == BGP_INSTANCE_TYPE_VIEW) {
- bnc->flags |= BGP_NEXTHOP_REGISTERED;
- bnc->flags |= BGP_NEXTHOP_VALID;
+ SET_FLAG(bnc->flags, BGP_NEXTHOP_REGISTERED);
+ SET_FLAG(bnc->flags, BGP_NEXTHOP_VALID);
} else if (!CHECK_FLAG(bnc->flags, BGP_NEXTHOP_REGISTERED))
register_zebra_rnh(bnc, is_bgp_static_route);
if (pi && pi->nexthop != bnc) {
return;
}
+ if (!bgp_zebra_num_connects()) {
+ if (BGP_DEBUG(zebra, ZEBRA))
+ zlog_debug("%s: We have not connected yet, cannot send nexthops",
+ __PRETTY_FUNCTION__);
+ }
p = &(bnc->node->p);
if ((command == ZEBRA_NEXTHOP_REGISTER
|| command == ZEBRA_IMPORT_ROUTE_REGISTER)
path->nexthop->path_count++;
}
}
+
+/*
+ * This function is called to register nexthops to zebra
+ * as that we may have tried to install the nexthops
+ * before we actually have a zebra connection
+ */
+void bgp_nht_register_nexthops(struct bgp *bgp)
+{
+ struct bgp_node *rn;
+ struct bgp_nexthop_cache *bnc;
+ afi_t afi;
+
+ for (afi = AFI_IP; afi < AFI_MAX; afi++) {
+ if (!bgp->nexthop_cache_table[afi])
+ continue;
+
+ for (rn = bgp_table_top(bgp->nexthop_cache_table[afi]); rn;
+ rn = bgp_route_next(rn)) {
+ bnc = bgp_nexthop_get_node_info(rn);
+
+ if (!bnc)
+ continue;
+
+ register_zebra_rnh(bnc, 0);
+ }
+ }
+}
*/
extern void path_nh_map(struct bgp_path_info *path,
struct bgp_nexthop_cache *bnc, bool make);
+/*
+ * When we actually have the connection to
+ * the zebra daemon, we need to reregister
+ * any nexthops we may have sitting around
+ */
+extern void bgp_nht_register_nexthops(struct bgp *bgp);
#endif /* _BGP_NHT_H */