Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: Do not convert EVPN prefixes into IPv4/IPv6 if not needed #15418

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 5 additions & 20 deletions lib/routemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2553,7 +2553,6 @@ route_map_result_t route_map_apply_ext(struct route_map *map,
struct route_map_index *index = NULL;
struct route_map_rule *set = NULL;
bool skip_match_clause = false;
struct prefix conv;

if (recursion > RMAP_RECURSION_LIMIT) {
flog_warn(
Expand All @@ -2571,27 +2570,14 @@ route_map_result_t route_map_apply_ext(struct route_map *map,

map->applied++;

/*
* 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) {
zlog_debug(
"Unable to convert EVPN prefix %pFX into IPv4/IPv6 prefix. Falling back to non-optimized route-map lookup",
prefix);
} else {
zlog_debug(
"Converted EVPN prefix %pFX into %pFX for optimized route-map lookup",
prefix, &conv);

prefix = &conv;
}
index = map->head;
} else {
skip_match_clause = true;
index = route_map_get_index(map, prefix, match_object,
&match_ret);
}

index = route_map_get_index(map, prefix, match_object, &match_ret);
if (index) {
index->applied++;
if (rmap_debug)
Expand All @@ -2615,7 +2601,6 @@ route_map_result_t route_map_apply_ext(struct route_map *map,
ret = RMAP_DENYMATCH;
goto route_map_apply_end;
}
skip_match_clause = true;

for (; index; index = index->next) {
if (!skip_match_clause) {
Expand Down
Loading