}
/* Copy the timers */
- if (old_client) {
- client->gr_instance_count = old_client->gr_instance_count;
- client->restart_time = old_client->restart_time;
-
- LOG_GR("%s : old client %s, gr_instance_count %d", __func__,
- zebra_route_string(old_client->proto),
- old_client->gr_instance_count);
-
- if (TAILQ_FIRST(&old_client->gr_info_queue)) {
- TAILQ_CONCAT(&client->gr_info_queue,
- &old_client->gr_info_queue, gr_info);
- TAILQ_INIT(&old_client->gr_info_queue);
- }
+ if (!old_client)
+ return;
- TAILQ_FOREACH (info, &client->gr_info_queue, gr_info) {
- info->stale_client_ptr = client;
- info->stale_client = false;
- }
+ client->gr_instance_count = old_client->gr_instance_count;
+ client->restart_time = old_client->restart_time;
+
+ LOG_GR("%s : old client %s, gr_instance_count %d", __func__,
+ zebra_route_string(old_client->proto),
+ old_client->gr_instance_count);
+
+ if (TAILQ_FIRST(&old_client->gr_info_queue)) {
+ TAILQ_CONCAT(&client->gr_info_queue, &old_client->gr_info_queue,
+ gr_info);
+ TAILQ_INIT(&old_client->gr_info_queue);
+ }
- /* Delete the stale client */
- listnode_delete(zrouter.stale_client_list, old_client);
- /* Delete old client */
- XFREE(MTYPE_TMP, old_client);
+ TAILQ_FOREACH (info, &client->gr_info_queue, gr_info) {
+ info->stale_client_ptr = client;
+ info->stale_client = false;
}
+
+ /* Delete the stale client */
+ listnode_delete(zrouter.stale_client_list, old_client);
+ /* Delete old client */
+ XFREE(MTYPE_TMP, old_client);
}
/*
return;
}
+ /* GR only for dynamic clients */
+ if (client->proto <= ZEBRA_ROUTE_CONNECT) {
+ LOG_GR("%s: GR capabilities for client %s not supported",
+ __func__, zebra_route_string(client->proto));
+ return;
+ }
/* Call the capabilities handler */
zebra_client_capabilities_handler(client, &api);
}
close(client->sock);
- if (!client->gr_instance_count) {
+ if (DYNAMIC_CLIENT_GR_DISABLED(client)) {
nroutes = rib_score_proto(client->proto,
client->instance);
zlog_notice(
* If any instance are graceful restart enabled,
* client is not deleted
*/
- if (!client->gr_instance_count) {
+ if (DYNAMIC_CLIENT_GR_DISABLED(client)) {
if (IS_ZEBRA_DEBUG_EVENT)
zlog_debug("%s: Deleting client %s", __func__,
zebra_route_string(client->proto));