Skip to content

Commit

Permalink
bgpd: fix import of evpn routes into vni/vrf/esi after nexthop update
Browse files Browse the repository at this point in the history
Related to issue #10271

After an update of the BGP nexthop (e.g. update of the igp metric), the
EVPN routes are not updated in VNIs, VRFs and ESIs.

Fix the issue.

Signed-off-by: Louis Scalbert <[email protected]>
  • Loading branch information
louis-6wind committed Jan 19, 2022
1 parent c748ab2 commit 2641ab9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bgpd/bgp_evpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2496,8 +2496,11 @@ static int install_evpn_route_entry_in_vrf(struct bgp *bgp_vrf,
pi = bgp_create_evpn_bgp_path_info(parent_pi, dest, &attr);
new_pi = true;
} else {
if (attrhash_cmp(pi->attr, &attr)
&& !CHECK_FLAG(pi->flags, BGP_PATH_REMOVED)) {
if (attrhash_cmp(pi->attr, &attr) &&
((pi->extra && parent_pi->extra &&
pi->extra->igpmetric == parent_pi->extra->igpmetric) ||
(!pi->extra && !parent_pi->extra)) &&
!CHECK_FLAG(pi->flags, BGP_PATH_REMOVED)) {
bgp_dest_unlock_node(dest);
return 0;
}
Expand Down
5 changes: 5 additions & 0 deletions bgpd/bgp_nht.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,11 @@ void evaluate_paths(struct bgp_nexthop_cache *bnc)
bgp_evpn_import_route(bgp_path,
afi, safi, bgp_dest_get_prefix(dest), path);
}
} else if (safi == SAFI_EVPN &&
bgp_evpn_is_prefix_nht_supported(
bgp_dest_get_prefix(dest))) {
bgp_evpn_import_route(bgp_path, afi, safi,
bgp_dest_get_prefix(dest), path);
}

bgp_process(bgp_path, dest, afi, safi);
Expand Down

0 comments on commit 2641ab9

Please sign in to comment.