summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorRyoga Saito <contact@proelbtn.com>2021-08-31 08:56:00 +0200
committerRyoga Saito <contact@proelbtn.com>2021-09-03 03:19:49 +0200
commitcc8f05dfdc6dd8bcf6c6e716b444e12172214a16 (patch)
tree8f72949ede3dd826037511597e5c57d655e67ce9 /bgpd
parentbgpd: introduce SID structure information (diff)
downloadfrr-cc8f05dfdc6dd8bcf6c6e716b444e12172214a16.tar.xz
frr-cc8f05dfdc6dd8bcf6c6e716b444e12172214a16.zip
bgpd: add transpose operation
if advertisement with SID structure Sub-Sub-TLV, we need to transpose SID, so added transpose operation into bgp_update. Signed-off-by: Ryoga Saito <contact@proelbtn.com>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_route.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index f97a791da..7e5521ad2 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -4044,6 +4044,20 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
sid_copy(&extra->sid[0],
&attr->srv6_l3vpn->sid);
extra->num_sids = 1;
+
+ /*
+ * draft-ietf-bess-srv6-services-07
+ * The part of SRv6 SID may be encoded as MPLS
+ * Label for the efficient packing.
+ */
+ if (attr->srv6_l3vpn->transposition_len != 0)
+ transpose_sid(
+ &extra->sid[0],
+ decode_label(label),
+ attr->srv6_l3vpn
+ ->transposition_offset,
+ attr->srv6_l3vpn
+ ->transposition_len);
}
} else if (attr->srv6_vpn) {
extra = bgp_path_info_extra_get(pi);
@@ -4231,6 +4245,17 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
if (attr->srv6_l3vpn) {
sid_copy(&extra->sid[0], &attr->srv6_l3vpn->sid);
extra->num_sids = 1;
+
+ /*
+ * draft-ietf-bess-srv6-services-07
+ * The part of SRv6 SID may be encoded as MPLS Label for
+ * the efficient packing.
+ */
+ if (attr->srv6_l3vpn->transposition_len != 0)
+ transpose_sid(
+ &extra->sid[0], decode_label(label),
+ attr->srv6_l3vpn->transposition_offset,
+ attr->srv6_l3vpn->transposition_len);
} else if (attr->srv6_vpn) {
sid_copy(&extra->sid[0], &attr->srv6_vpn->sid);
extra->num_sids = 1;