MGMTD_FE_SERVER_PATH, mgmt_fe_client_notify_connect,
mgmt_fe_client_notify_disconnect,
mgmt_fe_client_process_msg, MGMTD_FE_MAX_NUM_MSG_PROC,
- MGMTD_FE_MAX_NUM_MSG_WRITE, MGMTD_FE_MSG_MAX_LEN, false,
+ MGMTD_FE_MAX_NUM_MSG_WRITE, MGMTD_FE_MSG_MAX_LEN, true,
"FE-client", MGMTD_DBG_FE_CLIENT_CHECK());
MGMTD_FE_CLIENT_DBG("Initialized client '%s'", params->name);
session->client_ctx = client_ctx;
session->session_id = 0;
+ mgmt_sessions_add_tail(&client_ctx->client_sessions, session);
+
if (mgmt_fe_send_session_req(client_ctx, session, true) != 0) {
XFREE(MTYPE_MGMTD_FE_SESSION, session);
return MGMTD_INTERNAL_ERROR;
}
- mgmt_sessions_add_tail(&client_ctx->client_sessions, session);
return MGMTD_SUCCESS;
}
header[3] = ret;
buffer_put(vty->obuf, header, 4);
- if (!vty->t_write && (vtysh_flush(vty) < 0))
+ /* XXX this is crashing */
+ // if (!vty->t_write && (vtysh_flush(vty) < 0))
+ if (!vty->t_write)
/* Try to flush results; exit if a write
* error occurs.
*/
int cnt;
bool implicit_commit = false;
+ if (mgmt_lib_hndl && vty->mgmt_client_id && !vty->mgmt_session_id) {
+ /*
+ * We are connected to mgmtd but we do not yet have an
+ * established session. this means we need to send any changes
+ * made during this "down-time" to all backend clients when this
+ * FE client finishes coming up.
+ */
+ MGMTD_FE_CLIENT_DBG("skipping as no session exists");
+ return 0;
+ }
+
if (mgmt_lib_hndl && vty->mgmt_session_id) {
cnt = 0;
for (indx = 0; indx < vty->num_cfg_changes; indx++) {