1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

MPLS: Improve handling of static label allocations

Use mpls_new_label() / mpls_free_label() also for static labels, to keep
track of allocated labels and to enforce label ranges.

Static label allocations always use static label range, regardless of
configured label range.
This commit is contained in:
Ondrej Zajicek
2023-09-23 17:55:01 +02:00
parent 81a20ca5d8
commit b6385decb3
2 changed files with 24 additions and 16 deletions

View File

@@ -91,7 +91,7 @@ void mpls_domain_postconfig(struct mpls_domain_config *cf);
struct mpls_range_config * mpls_range_config_new(struct mpls_domain_config *m, struct symbol *s);
void mpls_preconfig(struct config *c);
void mpls_commit(struct config *new, struct config *old);
uint mpls_new_label(struct mpls_domain *m, struct mpls_handle *h);
uint mpls_new_label(struct mpls_domain *m, struct mpls_handle *h, uint n);
void mpls_free_label(struct mpls_domain *m, struct mpls_handle *h, uint n);
static inline struct mpls_domain_config *cf_default_mpls_domain(struct config *cfg)
@@ -153,6 +153,7 @@ struct mpls_fec_map {
struct channel *channel; /* MPLS channel for FEC announcement */
struct mpls_domain *domain; /* MPLS domain, keeping reference */
struct mpls_handle *handle; /* Handle for allocation of labels */
struct mpls_handle *static_handle; /* Handle for static label allocations, optional */
struct iface *vrf_iface;
u8 mpls_rts; /* Source value used for MPLS routes (RTS_*) */