From 26c747ed6c0b0501c1fa6d7d07911a71bd051e1e Mon Sep 17 00:00:00 2001 From: Dmytro Shytyi Date: Wed, 15 Nov 2023 16:59:09 +0100 Subject: [PATCH] bgpd: extend make_prefix to form srv6-based prefix Enable the SRv6 SID prefix generation in make_prefix() function of bgp_nht.c. Signed-off-by: Dmytro Shytyi fixup: bgpd: extend make_prefix to form srv6-based prefix --- bgpd/bgp_nht.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index e2c103bb5290..72dcfb9885cd 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -1045,8 +1045,11 @@ static int make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p) break; case AFI_IP6: p->family = AF_INET6; - - if (is_bgp_static) { + if (pi->attr && pi->attr->srv6_l3vpn) { + IPV6_ADDR_COPY(&(p->u.prefix6), + &(pi->attr->srv6_l3vpn->sid)); + p->prefixlen = IPV6_MAX_BITLEN; + } else if (is_bgp_static) { p->u.prefix6 = p_orig->u.prefix6; p->prefixlen = p_orig->prefixlen; } else {