Skip to content

Commit

Permalink
zebra: add label chunk range in log when label manager request fails
Browse files Browse the repository at this point in the history
When the label manager is unable to provide a label chunk to
a routing service, an error message is displayed:

> Oct 11 11:47:27 vsr zebra[163745]: [YMY6E-K9JYD][EC 4043309085] Unable to assign Label Chunk [60;60] to bgp instance 0

There is missing information on the range that was requested.
Add this information in the log message.

> Oct 11 11:47:27 vsr zebra[163745]: [YMY6E-K9JYD][EC 4043309085] Unable to assign Label Chunk [60;60] to bgp instance 0

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Oct 13, 2023
1 parent df03bf9 commit 2b2b1af
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions zebra/label_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,19 @@ static int label_manager_get_chunk(struct label_manager_chunk **lmc,
{
*lmc = assign_label_chunk(client->proto, client->instance,
client->session_id, keep, size, base);
if (!*lmc) {
if (base != MPLS_LABEL_BASE_ANY)
flog_err(EC_ZEBRA_LM_CANNOT_ASSIGN_CHUNK,
"Unable to assign Label Chunk [%u;%u] to %s instance %u",
base, base + size - 1,
zebra_route_string(client->proto),
client->instance);
else
flog_err(EC_ZEBRA_LM_CANNOT_ASSIGN_CHUNK,
"Unable to assign Label Chunk size %u to %s instance %u",
size, zebra_route_string(client->proto),
client->instance);
}
return lm_get_chunk_response(*lmc, client, vrf_id);
}

Expand All @@ -479,11 +492,7 @@ int lm_client_connect_response(uint8_t proto, uint16_t instance,
int lm_get_chunk_response(struct label_manager_chunk *lmc, struct zserv *client,
vrf_id_t vrf_id)
{
if (!lmc)
flog_err(EC_ZEBRA_LM_CANNOT_ASSIGN_CHUNK,
"Unable to assign Label Chunk to %s instance %u",
zebra_route_string(client->proto), client->instance);
else if (IS_ZEBRA_DEBUG_PACKET)
if (lmc && IS_ZEBRA_DEBUG_PACKET)
zlog_debug("Assigned Label Chunk %u - %u to %s instance %u",
lmc->start, lmc->end,
zebra_route_string(client->proto), client->instance);
Expand Down

0 comments on commit 2b2b1af

Please sign in to comment.