summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_routemap.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2020-12-10 10:01:25 +0100
committerGitHub <noreply@github.com>2020-12-10 10:01:25 +0100
commit82b773e63ba79a422ef8fc95b3096c3cbede7b41 (patch)
tree46c4b9660b16f37de11906384d17a39187377863 /zebra/zebra_routemap.c
parentMerge pull request #7705 from chiragshah6/mdev (diff)
parentzebra: deny when route map is specified but does not exist yet (diff)
downloadfrr-82b773e63ba79a422ef8fc95b3096c3cbede7b41.tar.xz
frr-82b773e63ba79a422ef8fc95b3096c3cbede7b41.zip
Merge pull request #7524 from donaldsharp/zebra_route_map_tighten
zebra: deny when route map is specified but does not exist yet
Diffstat (limited to 'zebra/zebra_routemap.c')
-rw-r--r--zebra/zebra_routemap.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c
index 7b0a1e3d9..0ce724f60 100644
--- a/zebra/zebra_routemap.c
+++ b/zebra/zebra_routemap.c
@@ -1682,6 +1682,7 @@ zebra_route_map_check(int family, int rib_type, uint8_t instance,
struct zebra_vrf *zvrf, route_tag_t tag)
{
struct route_map *rmap = NULL;
+ char *rm_name;
route_map_result_t ret = RMAP_PERMITMATCH;
struct nh_rmap_obj nh_obj;
@@ -1692,10 +1693,20 @@ zebra_route_map_check(int family, int rib_type, uint8_t instance,
nh_obj.metric = 0;
nh_obj.tag = tag;
- if (rib_type >= 0 && rib_type < ZEBRA_ROUTE_MAX)
+ if (rib_type >= 0 && rib_type < ZEBRA_ROUTE_MAX) {
+ rm_name = PROTO_RM_NAME(zvrf, family, rib_type);
rmap = PROTO_RM_MAP(zvrf, family, rib_type);
- if (!rmap && PROTO_RM_NAME(zvrf, family, ZEBRA_ROUTE_MAX))
+
+ if (rm_name && !rmap)
+ return RMAP_DENYMATCH;
+ }
+ if (!rmap) {
+ rm_name = PROTO_RM_NAME(zvrf, family, ZEBRA_ROUTE_MAX);
rmap = PROTO_RM_MAP(zvrf, family, ZEBRA_ROUTE_MAX);
+
+ if (rm_name && !rmap)
+ return RMAP_DENYMATCH;
+ }
if (rmap) {
ret = route_map_apply(rmap, p, &nh_obj);
}