Loosened strict RFC6022 session transport requirement due to race condition in clixon_snmp

This commit is contained in:
Olof hagsand 2023-01-16 11:03:21 +01:00
parent 000cb866c2
commit 0324135043
4 changed files with 22 additions and 3 deletions

View file

@ -828,6 +828,16 @@ clicon_session_id_get(clicon_handle h,
return 0;
}
/*! Delete session id
*/
int
clicon_session_id_del(clicon_handle h)
{
clicon_hash_t *cdat = clicon_data(h);
return clicon_hash_del(cdat, (char*)"session-id");
}
/*! Set session id
* @param[in] h Clicon handle
* @param[in] id Session id

View file

@ -223,7 +223,9 @@ clicon_rpc_msg(clicon_handle h,
goto done;
}
/* To disable this restart, unset PROTO_RESTART_RECONNECT */
clicon_session_id_del(h);
clicon_log(LOG_WARNING, "The backend was probably restarted and the client has reconnected to the backend. Any locks or candidate edits are lost.");
}
#else
clicon_err(OE_PROTO, ESHUTDOWN, "Unexpected close of CLICON_SOCK. Clixon backend daemon may have crashed.");