summaryrefslogtreecommitdiff
path: root/zebra/label_manager.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2023-10-13 10:20:30 +0200
committerPhilippe Guibert <philippe.guibert@6wind.com>2023-10-13 14:01:29 +0200
commit69886228326443941a65f87e7ee6fb42323f825b (patch)
treed2b10c2ef990df475d0bc7a38e611fbf4628df56 /zebra/label_manager.c
parentdf03bf95eb111c4c59ac6bddab38372b0c22748a (diff)
zebra: merge lm_get_chunk_response() function
This function lm_get_chunk_response() is only called by label_manager_get_chunk(). Let us move the code of the function in the caller. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/label_manager.c')
-rw-r--r--zebra/label_manager.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/zebra/label_manager.c b/zebra/label_manager.c
index 0be0b4e732..d934ae2322 100644
--- a/zebra/label_manager.c
+++ b/zebra/label_manager.c
@@ -456,7 +456,17 @@ 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)
+ 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);
}
/* Respond to a connect request */
@@ -475,22 +485,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);