summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/mgmt_fe_client.c5
-rw-r--r--lib/mgmt_fe_client.h6
-rw-r--r--lib/routemap_northbound.c10
-rw-r--r--lib/vty.c6
-rw-r--r--lib/vty.h4
5 files changed, 30 insertions, 1 deletions
diff --git a/lib/mgmt_fe_client.c b/lib/mgmt_fe_client.c
index da19db463f..7e42e1c09e 100644
--- a/lib/mgmt_fe_client.c
+++ b/lib/mgmt_fe_client.c
@@ -629,6 +629,11 @@ uint mgmt_fe_client_session_count(struct mgmt_fe_client *client)
return mgmt_sessions_count(&client->sessions);
}
+bool mgmt_fe_client_current_msg_short_circuit(struct mgmt_fe_client *client)
+{
+ return client->client.conn.is_short_circuit;
+}
+
/*
* Create a new Session for a Frontend Client connection.
*/
diff --git a/lib/mgmt_fe_client.h b/lib/mgmt_fe_client.h
index 286141da44..349b7e4cf4 100644
--- a/lib/mgmt_fe_client.h
+++ b/lib/mgmt_fe_client.h
@@ -373,6 +373,12 @@ extern void mgmt_fe_client_destroy(struct mgmt_fe_client *client);
*/
extern uint mgmt_fe_client_session_count(struct mgmt_fe_client *client);
+/*
+ * True if the current handled message is being short-circuited
+ */
+extern bool
+mgmt_fe_client_current_msg_short_circuit(struct mgmt_fe_client *client);
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/routemap_northbound.c b/lib/routemap_northbound.c
index 4659850994..5767e0aacf 100644
--- a/lib/routemap_northbound.c
+++ b/lib/routemap_northbound.c
@@ -353,6 +353,7 @@ static int
lib_route_map_entry_exit_policy_modify(struct nb_cb_modify_args *args)
{
struct route_map_index *rmi;
+ struct route_map *map;
int rm_action;
int policy;
@@ -382,6 +383,7 @@ lib_route_map_entry_exit_policy_modify(struct nb_cb_modify_args *args)
break;
case NB_EV_APPLY:
rmi = nb_running_get_entry(args->dnode, NULL, true);
+ map = rmi->map;
policy = yang_dnode_get_enum(args->dnode, NULL);
switch (policy) {
@@ -395,6 +397,14 @@ lib_route_map_entry_exit_policy_modify(struct nb_cb_modify_args *args)
rmi->exitpolicy = RMAP_GOTO;
break;
}
+
+ /* Execute event hook. */
+ if (route_map_master.event_hook) {
+ (*route_map_master.event_hook)(map->name);
+ route_map_notify_dependencies(map->name,
+ RMAP_EVENT_CALL_ADDED);
+ }
+
break;
}
diff --git a/lib/vty.c b/lib/vty.c
index c9de00a271..23aa2d1f38 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -3524,6 +3524,7 @@ static void vty_mgmt_ds_lock_notified(struct mgmt_fe_client *client,
char *errmsg_if_any)
{
struct vty *vty;
+ bool is_short_circuit = mgmt_fe_client_current_msg_short_circuit(client);
vty = (struct vty *)session_ctx;
@@ -3540,8 +3541,10 @@ static void vty_mgmt_ds_lock_notified(struct mgmt_fe_client *client,
vty->mgmt_locked_running_ds = lock_ds;
}
- if (vty->mgmt_req_pending_cmd)
+ if (!is_short_circuit && vty->mgmt_req_pending_cmd) {
+ assert(!strcmp(vty->mgmt_req_pending_cmd, "MESSAGE_LOCKDS_REQ"));
vty_mgmt_resume_response(vty, success);
+ }
}
static void vty_mgmt_set_config_result_notified(
@@ -3734,6 +3737,7 @@ int vty_mgmt_send_config_data(struct vty *vty, bool implicit_commit)
} else if (vty_mgmt_lock_running_inline(vty)) {
vty_out(vty,
"%% command failed, could not lock running DS\n");
+ vty_mgmt_unlock_candidate_inline(vty);
return -1;
}
}
diff --git a/lib/vty.h b/lib/vty.h
index ac3d2e5019..a8654f8b69 100644
--- a/lib/vty.h
+++ b/lib/vty.h
@@ -231,6 +231,10 @@ struct vty {
const char *mgmt_req_pending_cmd;
bool mgmt_locked_candidate_ds;
bool mgmt_locked_running_ds;
+ /* Need to track when we file-lock in vtysh to re-lock on end/conf t
+ * workaround
+ */
+ bool vtysh_file_locked;
};
static inline void vty_push_context(struct vty *vty, int node, uint64_t id)