static int zebra_read_route(int command, struct zclient *zclient,
zebra_size_t length, vrf_id_t vrf_id)
{
+ enum nexthop_types_t nhtype;
struct zapi_route api;
union g_addr nexthop;
- unsigned int ifindex;
+ ifindex_t ifindex;
int add, i;
struct bgp *bgp;
nexthop = api.nexthops[0].gate;
ifindex = api.nexthops[0].ifindex;
+ nhtype = api.nexthops[0].type;
add = (command == ZEBRA_REDISTRIBUTE_ROUTE_ADD);
if (add) {
/* Now perform the add/update. */
bgp_redistribute_add(bgp, &api.prefix, &nexthop, ifindex,
- api.metric, api.type, api.instance,
- api.tag);
+ nhtype, api.metric, api.type,
+ api.instance, api.tag);
} else {
bgp_redistribute_delete(bgp, &api.prefix, api.type,
api.instance);
vrf_bitmap_set(zclient->redist[afi][type], bgp->vrf_id);
}
- /* Don't try to register if we're not connected to Zebra or Zebra
- * doesn't
- * know of this instance.
+ /*
+ * Don't try to register if we're not connected to Zebra or Zebra
+ * doesn't know of this instance.
+ *
+ * When we come up later well resend if needed.
*/
if (!bgp_install_info_to_zebra(bgp))
- return CMD_WARNING_CONFIG_FAILED;
+ return CMD_SUCCESS;
if (BGP_DEBUG(zebra, ZEBRA))
zlog_debug("Tx redistribute add VRF %u afi %d %s %d",
zclient_num_connects = 0;
/* Set default values. */
- zclient = zclient_new(master);
+ zclient = zclient_new_notify(master, &zclient_options_default);
zclient_init(zclient, ZEBRA_ROUTE_BGP, 0, &bgpd_privs);
zclient->zebra_connected = bgp_zebra_connected;
zclient->router_id_update = bgp_router_id_update;