mirror of
https://github.com/FRRouting/frr.git
synced 2025-05-01 05:57:15 +02:00
mgmtd: allow dest DS "running" if implicit lock+commit
Signed-off-by: Christian Hopps <chopps@labn.net>
This commit is contained in:
parent
0913d9fc0e
commit
d57a6f761e
|
@ -1406,7 +1406,12 @@ static void fe_adapter_handle_edit(struct mgmt_fe_session_ctx *session,
|
||||||
bool lock, commit;
|
bool lock, commit;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (msg->datastore != MGMT_MSG_DATASTORE_CANDIDATE) {
|
lock = CHECK_FLAG(msg->flags, EDIT_FLAG_IMPLICIT_LOCK);
|
||||||
|
commit = CHECK_FLAG(msg->flags, EDIT_FLAG_IMPLICIT_COMMIT);
|
||||||
|
|
||||||
|
if (lock && commit && msg->datastore == MGMT_MSG_DATASTORE_RUNNING)
|
||||||
|
;
|
||||||
|
else if (msg->datastore != MGMT_MSG_DATASTORE_CANDIDATE) {
|
||||||
fe_adapter_send_error(session, msg->req_id, false, -EINVAL,
|
fe_adapter_send_error(session, msg->req_id, false, -EINVAL,
|
||||||
"Unsupported datastore");
|
"Unsupported datastore");
|
||||||
return;
|
return;
|
||||||
|
@ -1427,9 +1432,6 @@ static void fe_adapter_handle_edit(struct mgmt_fe_session_ctx *session,
|
||||||
rds_ctx = mgmt_ds_get_ctx_by_id(mm, rds_id);
|
rds_ctx = mgmt_ds_get_ctx_by_id(mm, rds_id);
|
||||||
assert(rds_ctx);
|
assert(rds_ctx);
|
||||||
|
|
||||||
lock = CHECK_FLAG(msg->flags, EDIT_FLAG_IMPLICIT_LOCK);
|
|
||||||
commit = CHECK_FLAG(msg->flags, EDIT_FLAG_IMPLICIT_COMMIT);
|
|
||||||
|
|
||||||
if (lock) {
|
if (lock) {
|
||||||
if (mgmt_fe_session_write_lock_ds(ds_id, ds_ctx, session)) {
|
if (mgmt_fe_session_write_lock_ds(ds_id, ds_ctx, session)) {
|
||||||
fe_adapter_send_error(session, msg->req_id, false,
|
fe_adapter_send_error(session, msg->req_id, false,
|
||||||
|
|
Loading…
Reference in a new issue