diff options
| author | Naveen Thanikachalam <nthanikachal@vmware.com> | 2018-09-20 21:15:49 -0700 |
|---|---|---|
| committer | Naveen Thanikachalam <nthanikachal@vmware.com> | 2018-09-20 22:07:29 -0700 |
| commit | fdf823db5597f3c59b01c7e01b0140a7fd39a7c9 (patch) | |
| tree | a608e811aeff617d714f5544bf933f1bf8b41dcd | |
| parent | dc790ba83d9ff3b0fa31993bea7682e720f3023b (diff) | |
lib: Trigger callbacks to re-evaluate route-map clauses when "call" CLI is executed.
When the "call" CLI is executed from with-in a route-map that is already in use,
there is a need to get the route-map clients to re-evalute the clauses defined
by both the parent route-map, as well as the child route-map.
The existing callbacks, add_hook() and delete_hook() can be used by the lib to
inform the clients when the "call" is configured and unconfigured.
Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
| -rw-r--r-- | lib/routemap.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/routemap.c b/lib/routemap.c index 66c15b9f2b..bec6d389e5 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -1759,8 +1759,19 @@ void route_map_upd8_dependency(route_map_event_t type, const char *arg, { struct hash *upd8_hash = NULL; - if ((upd8_hash = route_map_get_dep_hash(type))) + if ((upd8_hash = route_map_get_dep_hash(type))) { route_map_dep_update(upd8_hash, arg, rmap_name, type); + + if (type == RMAP_EVENT_CALL_ADDED) { + /* Execute hook. */ + if (route_map_master.add_hook) + (*route_map_master.add_hook)(rmap_name); + } else if (type == RMAP_EVENT_CALL_DELETED) { + /* Execute hook. */ + if (route_map_master.delete_hook) + (*route_map_master.delete_hook)(rmap_name); + } + } } void route_map_notify_dependencies(const char *affected_name, |
