diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2024-01-25 13:54:45 +0200 | 
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2024-01-26 12:34:46 -0500 | 
| commit | d79ca934eb4c8084324ae8a570fc68d2b861b47d (patch) | |
| tree | c196aa4bf4462ed8add03cf9f33909848df759d3 /mgmtd/mgmt_be_adapter.c | |
| parent | b92ad5046e9dd7c4b335906a0bf3b38a3ff55454 (diff) | |
mgmtd: fix commit request overwrite
There are places, where we can receive an existing commit transaction.
If we don't check that the request already exists, it gets overwritten
and we start having problems with transaction refcounters. Forbid having
multiple configuration sessions simultaneously.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'mgmtd/mgmt_be_adapter.c')
| -rw-r--r-- | mgmtd/mgmt_be_adapter.c | 21 | 
1 files changed, 5 insertions, 16 deletions
diff --git a/mgmtd/mgmt_be_adapter.c b/mgmtd/mgmt_be_adapter.c index 4f5ad6e0b0..8e719457f6 100644 --- a/mgmtd/mgmt_be_adapter.c +++ b/mgmtd/mgmt_be_adapter.c @@ -608,27 +608,16 @@ static void mgmt_be_adapter_conn_init(struct event *thread)  	assert(adapter && adapter->conn->fd >= 0);  	/* -	 * Check first if the current session can run a CONFIG -	 * transaction or not. Reschedule if a CONFIG transaction -	 * from another session is already in progress. -	 */ -	if (mgmt_config_txn_in_progress() != MGMTD_SESSION_ID_NONE) { -		zlog_err("XXX txn in progress, retry init"); -		mgmt_be_adapter_sched_init_event(adapter); -		return; -	} - -	/*  	 * Notify TXN module to create a CONFIG transaction and  	 * download the CONFIGs identified for this new client.  	 * If the TXN module fails to initiate the CONFIG transaction -	 * disconnect from the client forcing a reconnect later. -	 * That should also take care of destroying the adapter. +	 * retry a bit later. It only fails if there's an existing config +	 * transaction in progress.  	 */  	if (mgmt_txn_notify_be_adapter_conn(adapter, true) != 0) { -		zlog_err("XXX notify be adapter conn fail"); -		msg_conn_disconnect(adapter->conn, false); -		adapter = NULL; +		zlog_err("XXX txn in progress, retry init"); +		mgmt_be_adapter_sched_init_event(adapter); +		return;  	}  }  | 
