diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2022-07-12 17:41:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-12 17:41:09 +0200 |
commit | 8cb56fb2738605c3babe0fc191339fbb52da8655 (patch) | |
tree | 022783a751567a9a87a8517e5ed73288084ce20b /lib | |
parent | Merge pull request #11577 from opensourcerouting/fix/memory_leak_bgp_gr_notif... (diff) | |
parent | tests : Topotest support to bgp_default_originate (diff) | |
download | frr-8cb56fb2738605c3babe0fc191339fbb52da8655.tar.xz frr-8cb56fb2738605c3babe0fc191339fbb52da8655.zip |
Merge pull request #11285 from iqras23/conditional_def_orig
Diffstat (limited to 'lib')
-rw-r--r-- | lib/routemap.c | 12 | ||||
-rw-r--r-- | lib/routemap.h | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/routemap.c b/lib/routemap.c index 7fd5a96e5..9529b7941 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -2540,7 +2540,8 @@ void route_map_notify_pentry_dependencies(const char *affected_name, */ route_map_result_t route_map_apply_ext(struct route_map *map, const struct prefix *prefix, - void *match_object, void *set_object) + void *match_object, void *set_object, + int *pref) { static int recursion = 0; enum route_map_cmd_result_t match_ret = RMAP_NOMATCH; @@ -2676,7 +2677,7 @@ route_map_result_t route_map_apply_ext(struct route_map *map, ret = route_map_apply_ext( nextrm, prefix, match_object, - set_object); + set_object, NULL); recursion--; } @@ -2721,6 +2722,13 @@ route_map_apply_end: (map ? map->name : "null"), prefix, route_map_result_str(ret)); + if (pref) { + if (index != NULL && ret == RMAP_PERMITMATCH) + *pref = index->pref; + else + *pref = 65536; + } + return (ret); } diff --git a/lib/routemap.h b/lib/routemap.h index 13dafe684..ad391981e 100644 --- a/lib/routemap.h +++ b/lib/routemap.h @@ -482,9 +482,9 @@ struct route_map *route_map_lookup_warn_noexist(struct vty *vty, const char *nam extern route_map_result_t route_map_apply_ext(struct route_map *map, const struct prefix *prefix, void *match_object, - void *set_object); + void *set_object, int *pref); #define route_map_apply(map, prefix, object) \ - route_map_apply_ext(map, prefix, object, object) + route_map_apply_ext(map, prefix, object, object, NULL) extern void route_map_add_hook(void (*func)(const char *)); extern void route_map_delete_hook(void (*func)(const char *)); |