Skip to content

Commit c6c570a

Browse files
authored
Merge pull request FRRouting#17899 from chiragshah6/evpn_dev1
bgpd: fix evpn path info get api
2 parents 2991b39 + c358b92 commit c6c570a

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

bgpd/bgp_evpn_mh.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4737,7 +4737,7 @@ bgp_evpn_path_nh_info_new(struct bgp_path_info *pi)
47374737
struct bgp_path_mh_info *mh_info;
47384738
struct bgp_path_evpn_nh_info *nh_info;
47394739

4740-
e = bgp_path_info_extra_get(pi);
4740+
e = bgp_evpn_path_info_extra_get(pi);
47414741

47424742
/* If mh_info doesn't exist allocate it */
47434743
mh_info = e->evpn->mh_info;

bgpd/bgp_route.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,19 @@ struct bgp_path_info_extra *bgp_path_info_extra_get(struct bgp_path_info *pi)
328328
return pi->extra;
329329
}
330330

331+
/* Get bgp_path_info extra along with evpn information for the given bgp_path_info.
332+
* This is used for EVPN imported routes like Type-5.
333+
*/
334+
struct bgp_path_info_extra *bgp_evpn_path_info_extra_get(struct bgp_path_info *pi)
335+
{
336+
if (!pi->extra)
337+
pi->extra = bgp_path_info_extra_new();
338+
if (!pi->extra->evpn)
339+
pi->extra->evpn = XCALLOC(MTYPE_BGP_ROUTE_EXTRA_EVPN,
340+
sizeof(struct bgp_path_info_extra_evpn));
341+
return pi->extra;
342+
}
343+
331344
bool bgp_path_info_has_valid_label(const struct bgp_path_info *path)
332345
{
333346
if (!BGP_PATH_INFO_NUM_LABELS(path))

bgpd/bgp_route.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,7 @@ extern void bgp_path_info_delete(struct bgp_dest *dest,
801801
struct bgp_path_info *pi);
802802
extern struct bgp_path_info_extra *
803803
bgp_path_info_extra_get(struct bgp_path_info *path);
804+
extern struct bgp_path_info_extra *bgp_evpn_path_info_extra_get(struct bgp_path_info *path);
804805
extern bool bgp_path_info_has_valid_label(const struct bgp_path_info *path);
805806
extern void bgp_path_info_set_flag(struct bgp_dest *dest,
806807
struct bgp_path_info *path, uint32_t flag);

0 commit comments

Comments
 (0)