summaryrefslogtreecommitdiff
path: root/lib/routemap_northbound.c
diff options
context:
space:
mode:
authorAlexander Chernavin <achernavin@netgate.com>2022-10-14 09:02:06 +0000
committerAlexander Chernavin <achernavin@netgate.com>2023-07-13 08:40:36 +0000
commit633eb6ee7742449d0644dda7fd83865e3c01f937 (patch)
tree33b7f74e8a9d8ea485c8edf315054620edadab5e /lib/routemap_northbound.c
parent6934a1d31d832e423376c49a10646dd9f4336cd3 (diff)
lib: fix on-match when added to existing route-map entry
Currently, "on-match (next|goto)" only works if already present in a route-map entry when the route-map is applied to the routes. However, if the command is added to an existing route-map entry, the route-map is not reapplied to the routes in order to accommodate the changes. And service restart is needed. The problem is that setting the command doesn't signal about the change to the listener (i.e. to a routing daemon). With this fix, signal to the listener about addition of "on-match (next|goto)" to a route-map entry. Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Diffstat (limited to 'lib/routemap_northbound.c')
-rw-r--r--lib/routemap_northbound.c10
1 files changed, 10 insertions, 0 deletions
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;
}