mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 20:18:56 +00:00
bgpd: add handling for special label
Add handling for reserved MPLS label like IMPLICIT_NULL (3). Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
This commit is contained in:
parent
bee2e7d08f
commit
d8b596bd23
@ -541,7 +541,7 @@ static uint32_t alloc_new_sid(struct bgp *bgp, uint32_t index,
|
|||||||
|
|
||||||
for (ALL_LIST_ELEMENTS_RO(bgp->srv6_locator_chunks, node, chunk)) {
|
for (ALL_LIST_ELEMENTS_RO(bgp->srv6_locator_chunks, node, chunk)) {
|
||||||
if (chunk->function_bits_length >
|
if (chunk->function_bits_length >
|
||||||
BGP_PREFIX_SID_SRV6_MAX_FUNCTION_LENGTH) {
|
BGP_PREFIX_SID_SRV6_MAX_FUNCTION_LENGTH) {
|
||||||
if (debug)
|
if (debug)
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: invalid SRv6 Locator chunk (%pFX): Function Length must be less or equal to %d",
|
"%s: invalid SRv6 Locator chunk (%pFX): Function Length must be less or equal to %d",
|
||||||
@ -568,15 +568,32 @@ static uint32_t alloc_new_sid(struct bgp *bgp, uint32_t index,
|
|||||||
|
|
||||||
if (index != 0) {
|
if (index != 0) {
|
||||||
label = index << shift_len;
|
label = index << shift_len;
|
||||||
|
if (label < MPLS_LABEL_UNRESERVED_MIN) {
|
||||||
|
if (debug)
|
||||||
|
zlog_debug(
|
||||||
|
"%s: skipped to allocate SRv6 SID (%pFX): Label (%u) is too small to use",
|
||||||
|
__func__, &chunk->prefix,
|
||||||
|
label);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
transpose_sid(sid, label, offset, func_len);
|
transpose_sid(sid, label, offset, func_len);
|
||||||
if (sid_exist(bgp, sid))
|
if (sid_exist(bgp, sid))
|
||||||
return false;
|
continue;
|
||||||
alloced = true;
|
alloced = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint32_t i = 1; i < index_max; i++) {
|
for (uint32_t i = 1; i < index_max; i++) {
|
||||||
label = i << shift_len;
|
label = i << shift_len;
|
||||||
|
if (label < MPLS_LABEL_UNRESERVED_MIN) {
|
||||||
|
if (debug)
|
||||||
|
zlog_debug(
|
||||||
|
"%s: skipped to allocate SRv6 SID (%pFX): Label (%u) is too small to use",
|
||||||
|
__func__, &chunk->prefix,
|
||||||
|
label);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
transpose_sid(sid, label, offset, func_len);
|
transpose_sid(sid, label, offset, func_len);
|
||||||
if (sid_exist(bgp, sid))
|
if (sid_exist(bgp, sid))
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user