From 9b775859cd7fd54a6fe2bd88359955fce079999d Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Tue, 26 Sep 2023 18:50:20 +0200 Subject: MPLS: Handle label allocation failures --- nest/rt-table.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'nest/rt-table.c') diff --git a/nest/rt-table.c b/nest/rt-table.c index 6eaee069..e497524f 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -1614,7 +1614,14 @@ rte_update2(struct channel *c, const net_addr *n, rte *new, struct rte_src *src) } if (p->mpls_map) - mpls_handle_rte(p->mpls_map, n, new, rte_update_pool, &fec); + { + if (mpls_handle_rte(p->mpls_map, n, new, rte_update_pool, &fec) < 0) + { + rte_trace_in(D_FILTERS, c, new, "invalid"); + stats->imp_updates_invalid++; + goto drop; + } + } if (!rta_is_cached(new->attrs)) /* Need to copy attributes */ new->attrs = rta_lookup(new->attrs); -- cgit v1.2.3