Skip to content

Commit

Permalink
Merge pull request FRRouting#17899 from chiragshah6/evpn_dev1
Browse files Browse the repository at this point in the history
bgpd: fix evpn path info get api
  • Loading branch information
ton31337 authored Jan 22, 2025
2 parents 2991b39 + c358b92 commit c6c570a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bgpd/bgp_evpn_mh.c
Original file line number Diff line number Diff line change
Expand Up @@ -4737,7 +4737,7 @@ bgp_evpn_path_nh_info_new(struct bgp_path_info *pi)
struct bgp_path_mh_info *mh_info;
struct bgp_path_evpn_nh_info *nh_info;

e = bgp_path_info_extra_get(pi);
e = bgp_evpn_path_info_extra_get(pi);

/* If mh_info doesn't exist allocate it */
mh_info = e->evpn->mh_info;
Expand Down
13 changes: 13 additions & 0 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,19 @@ struct bgp_path_info_extra *bgp_path_info_extra_get(struct bgp_path_info *pi)
return pi->extra;
}

/* Get bgp_path_info extra along with evpn information for the given bgp_path_info.
* This is used for EVPN imported routes like Type-5.
*/
struct bgp_path_info_extra *bgp_evpn_path_info_extra_get(struct bgp_path_info *pi)
{
if (!pi->extra)
pi->extra = bgp_path_info_extra_new();
if (!pi->extra->evpn)
pi->extra->evpn = XCALLOC(MTYPE_BGP_ROUTE_EXTRA_EVPN,
sizeof(struct bgp_path_info_extra_evpn));
return pi->extra;
}

bool bgp_path_info_has_valid_label(const struct bgp_path_info *path)
{
if (!BGP_PATH_INFO_NUM_LABELS(path))
Expand Down
1 change: 1 addition & 0 deletions bgpd/bgp_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,7 @@ extern void bgp_path_info_delete(struct bgp_dest *dest,
struct bgp_path_info *pi);
extern struct bgp_path_info_extra *
bgp_path_info_extra_get(struct bgp_path_info *path);
extern struct bgp_path_info_extra *bgp_evpn_path_info_extra_get(struct bgp_path_info *path);
extern bool bgp_path_info_has_valid_label(const struct bgp_path_info *path);
extern void bgp_path_info_set_flag(struct bgp_dest *dest,
struct bgp_path_info *path, uint32_t flag);
Expand Down

0 comments on commit c6c570a

Please sign in to comment.