summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2023-10-13 11:49:48 -0400
committerGitHub <noreply@github.com>2023-10-13 11:49:48 -0400
commit4fa73b6572df03fd9df7ffddf279abbcf8ad6b9c (patch)
treea34251fc4640f5cfdb950d727da502c7f43f9f48
parent4875e62b3aea4d2fc8637b8d7d069d612fe7edc0 (diff)
parent1cedcf7b15ee72fe859189bf772081a141fb50e6 (diff)
Merge pull request #14584 from pguibert6WIND/lmc_log_display_chunk
zebra: add label chunk range in log when label manager request fails
-rw-r--r--zebra/label_manager.c36
-rw-r--r--zebra/label_manager.h2
2 files changed, 19 insertions, 19 deletions
diff --git a/zebra/label_manager.c b/zebra/label_manager.c
index 0be0b4e732..fa7dbb0a25 100644
--- a/zebra/label_manager.c
+++ b/zebra/label_manager.c
@@ -456,7 +456,25 @@ 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);
- return lm_get_chunk_response(*lmc, client, vrf_id);
+ /* Respond to a get_chunk request */
+ if (!*lmc) {
+ if (base == MPLS_LABEL_BASE_ANY)
+ 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);
+ else
+ 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 if (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);
+
+ return zsend_assign_label_chunk_response(client, vrf_id, *lmc);
}
/* Respond to a connect request */
@@ -475,22 +493,6 @@ int lm_client_connect_response(uint8_t proto, uint16_t instance,
return zsend_label_manager_connect_response(client, vrf_id, result);
}
-/* Respond to a get_chunk request */
-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)
- zlog_debug("Assigned Label Chunk %u - %u to %s instance %u",
- lmc->start, lmc->end,
- zebra_route_string(client->proto), client->instance);
-
- return zsend_assign_label_chunk_response(client, vrf_id, lmc);
-}
-
void label_manager_close(void)
{
list_delete(&lbl_mgr.lc_list);
diff --git a/zebra/label_manager.h b/zebra/label_manager.h
index cfbb4bd169..74f40fab23 100644
--- a/zebra/label_manager.h
+++ b/zebra/label_manager.h
@@ -78,8 +78,6 @@ void lm_release_chunk_call(struct zserv *client, uint32_t start,
int lm_client_connect_response(uint8_t proto, uint16_t instance,
uint32_t session_id, vrf_id_t vrf_id,
uint8_t result);
-int lm_get_chunk_response(struct label_manager_chunk *lmc, struct zserv *client,
- vrf_id_t vrf_id);
/* convenience function to allocate an lmc to be consumed by the above API */
struct label_manager_chunk *