diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/mgmt_fe_client.c | 5 | ||||
| -rw-r--r-- | lib/vty.c | 15 |
2 files changed, 17 insertions, 3 deletions
diff --git a/lib/mgmt_fe_client.c b/lib/mgmt_fe_client.c index 9f87c38784..a7f86201de 100644 --- a/lib/mgmt_fe_client.c +++ b/lib/mgmt_fe_client.c @@ -645,7 +645,7 @@ uintptr_t mgmt_fe_client_lib_init(struct mgmt_fe_client_params *params, 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); @@ -683,11 +683,12 @@ enum mgmt_result mgmt_fe_create_client_session(uintptr_t lib_hndl, 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; } @@ -146,7 +146,9 @@ void vty_mgmt_resume_response(struct vty *vty, bool 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. */ @@ -3493,6 +3495,17 @@ int vty_mgmt_send_config_data(struct vty *vty) 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++) { |
