]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: add label chunk range in log when label manager request fails 14593/head
authorPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 12 Oct 2023 15:44:47 +0000 (17:44 +0200)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Fri, 13 Oct 2023 15:50:36 +0000 (15:50 +0000)
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 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 <philippe.guibert@6wind.com>
(cherry picked from commit 1cedcf7b15ee72fe859189bf772081a141fb50e6)

zebra/label_manager.c

index d934ae23223b5fafc938da207154cd67ca4a2ce1..fa7dbb0a25028fcc6260eef358980d2a15f56436 100644 (file)
@@ -457,11 +457,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);
        /* 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)
+       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);