bgpd: announce locators instead of transposed SIDs

This patch changes the format of the Prefix-SID advertised by
bgpd. In current implementation, transposed SIDs were
advertised, which caused two problems:

1. bgpd that receives SRv6 L3VPN routes whose SID is
   transposed couldn't put bgp_attr_srv6_l3vpn whose those
   routes together. This leads extra memory consumption.

2. Some implementation will reject a route with transposed SID.
   This will affect interoperability.

For those reasons, in this patch, instead of advertising
transposed SID, we change it to advertise the locator of SID.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
This commit is contained in:
Ryoga Saito 2022-02-25 13:42:32 +00:00
parent 921c7e77b0
commit 69fe7874e0

View File

@ -1244,7 +1244,7 @@ void vpn_leak_from_vrf_update(struct bgp *bgp_vpn, /* to */
static_attr.originator_id = bgp_vpn->router_id;
/* Set SID for SRv6 VPN */
if (bgp_vrf->vpn_policy[afi].tovpn_sid) {
if (bgp_vrf->vpn_policy[afi].tovpn_sid_locator) {
encode_label(bgp_vrf->vpn_policy[afi].tovpn_sid_transpose_label,
&label);
static_attr.srv6_l3vpn = XCALLOC(MTYPE_BGP_SRV6_L3VPN,
@ -1264,8 +1264,8 @@ void vpn_leak_from_vrf_update(struct bgp *bgp_vpn, /* to */
static_attr.srv6_l3vpn->transposition_offset =
BGP_PREFIX_SID_SRV6_TRANSPOSITION_OFFSET;
memcpy(&static_attr.srv6_l3vpn->sid,
bgp_vrf->vpn_policy[afi].tovpn_sid,
sizeof(static_attr.srv6_l3vpn->sid));
bgp_vrf->vpn_policy[afi].tovpn_sid_locator,
sizeof(struct in6_addr));
}