summaryrefslogtreecommitdiff
path: root/lib/routemap_northbound.c
diff options
context:
space:
mode:
authorrgirada <rgirada@vmware.com>2021-02-18 20:15:40 -0800
committerIgor Ryzhov <iryzhov@nfware.com>2021-04-29 17:23:37 +0300
commit4fc5dafd1c8167a98e3a5f51efc1ea5092513364 (patch)
treef9cf2f3cd2efe9cd0049cf36be44a170236d90c8 /lib/routemap_northbound.c
parent6e0368f61af5f63cce4c4bef1dee72db958ea59e (diff)
lib: Routemap is not getting applied upon changing the routemap action
Description: This looks broken after NB changes in routemap. When routemap action modified from permit to deny, it is expected to apply the new action on the filtered routes before the action in the routemap data structure has been changed. But currently this is not handled by the corresponding northbound API. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
Diffstat (limited to 'lib/routemap_northbound.c')
-rw-r--r--lib/routemap_northbound.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/routemap_northbound.c b/lib/routemap_northbound.c
index db06e9caac..3473ca2aea 100644
--- a/lib/routemap_northbound.c
+++ b/lib/routemap_northbound.c
@@ -271,6 +271,7 @@ lib_route_map_entry_description_destroy(struct nb_cb_destroy_args *args)
static int lib_route_map_entry_action_modify(struct nb_cb_modify_args *args)
{
struct route_map_index *rmi;
+ struct route_map *map;
switch (args->event) {
case NB_EV_VALIDATE:
@@ -281,7 +282,15 @@ static int lib_route_map_entry_action_modify(struct nb_cb_modify_args *args)
case NB_EV_APPLY:
rmi = nb_running_get_entry(args->dnode, NULL, true);
rmi->type = yang_dnode_get_enum(args->dnode, NULL);
- /* TODO: notify? */
+ map = rmi->map;
+
+ /* 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;
}