summaryrefslogtreecommitdiff
path: root/lib/routemap.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-10-18 14:17:04 +0300
committerGitHub <noreply@github.com>2022-10-18 14:17:04 +0300
commit272c6d5db128ff7450fe9fcd16c046160594deb3 (patch)
tree83cf59443f6641c80260a0e75aded8211478bc34 /lib/routemap.c
parenta654221c7083dd27741b48f3167ca49c3c51048c (diff)
parenta5d7012ca0c04c97bd15b67e9f6e9211203b7c31 (diff)
Merge pull request #8647 from sworleys/DVNI-Config-Changes
bgpd: EVPN D-VNI L3 RT Config Enhancements
Diffstat (limited to 'lib/routemap.c')
-rw-r--r--lib/routemap.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/routemap.c b/lib/routemap.c
index 3a92799991..dcaecd8085 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -1815,7 +1815,24 @@ route_map_get_index(struct route_map *map, const struct prefix *prefix,
struct route_map_index *index = NULL, *best_index = NULL;
struct route_map_index *head_index = NULL;
struct route_table *table = NULL;
- unsigned char family = prefix->family;
+ struct prefix conv;
+ unsigned char family;
+
+ /*
+ * Handling for matching evpn_routes in the prefix table.
+ *
+ * We convert type2/5 prefix to ipv4/6 prefix to do longest
+ * prefix matching on.
+ */
+ if (prefix->family == AF_EVPN) {
+ if (evpn_prefix2prefix(prefix, &conv) != 0)
+ return NULL;
+
+ prefix = &conv;
+ }
+
+
+ family = prefix->family;
if (family == AF_INET)
table = map->ipv4_prefix_table;