summaryrefslogtreecommitdiff
path: root/bgpd/bgp_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_zebra.c')
-rw-r--r--bgpd/bgp_zebra.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index c295b06601..c0a9a38773 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -1260,6 +1260,7 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
struct bgp_path_info *mpinfo_cp = &local_info;
route_tag_t tag;
mpls_label_t label;
+ struct bgp_sid_info *sid_info;
int nh_othervrf = 0;
bool is_evpn;
bool nh_updated = false;
@@ -1476,9 +1477,22 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
if (mpinfo->extra && !sid_zero(&mpinfo->extra->sid[0].sid)
&& !CHECK_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE)) {
- memcpy(&api_nh->seg6_segs, &mpinfo->extra->sid[0].sid,
+ sid_info = &mpinfo->extra->sid[0];
+
+ memcpy(&api_nh->seg6_segs, &sid_info->sid,
sizeof(api_nh->seg6_segs));
+ if (sid_info->transposition_len != 0) {
+ if (!bgp_is_valid_label(
+ &mpinfo->extra->label[0]))
+ continue;
+
+ label = label_pton(&mpinfo->extra->label[0]);
+ transpose_sid(&api_nh->seg6_segs, label,
+ sid_info->transposition_offset,
+ sid_info->transposition_len);
+ }
+
SET_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_SEG6);
}
@@ -1496,7 +1510,8 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
sizeof(bzo.aspath));
if (info->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES))
- strlcpy(bzo.community, info->attr->community->str,
+ strlcpy(bzo.community,
+ bgp_attr_get_community(info->attr)->str,
sizeof(bzo.community));
if (info->attr->flag