diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2023-10-06 14:53:31 +0200 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2023-10-18 17:46:28 +0200 |
| commit | d3f686d163cbbf9cf2d82701098818a6b150f1ef (patch) | |
| tree | fb757c7ceb4db13609d71282a2a19188b49cb855 /zebra/label_manager.c | |
| parent | 3cae02642844eed25cd5f165774c19cbd54e8ca2 (diff) | |
zebra: do not accept static label requests conflicting with dynamic-block
A static label allocation should not be accepted if the desired range
conflicts with the configured dynamic-block configuration.
Do not accept such label requests, only when dynamic blocks are
configured.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/label_manager.c')
| -rw-r--r-- | zebra/label_manager.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/zebra/label_manager.c b/zebra/label_manager.c index 57a58af6bc..8ae6e0cc3f 100644 --- a/zebra/label_manager.c +++ b/zebra/label_manager.c @@ -345,6 +345,15 @@ assign_specific_label_chunk(uint8_t proto, unsigned short instance, return NULL; } + if ((lbl_mgr.dynamic_block_start != MPLS_LABEL_UNRESERVED_MIN || + lbl_mgr.dynamic_block_end != MPLS_LABEL_MAX) && + base >= lbl_mgr.dynamic_block_start && + end <= lbl_mgr.dynamic_block_end) { + zlog_warn("Invalid LM request arguments: base: %u, size: %u for %s in conflict with the dynamic label block", + base, size, zebra_route_string(proto)); + return NULL; + } + /* Scan the existing chunks to see if the requested range of labels * falls inside any of such chunks */ for (ALL_LIST_ELEMENTS_RO(lbl_mgr.lc_list, node, lmc)) { |
