]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: minor fix to label manager log 6174/head
authorEmanuele Di Pascale <emanuele@voltanet.io>
Thu, 2 Apr 2020 22:05:44 +0000 (00:05 +0200)
committerEmanuele Di Pascale <emanuele@voltanet.io>
Tue, 7 Apr 2020 09:33:16 +0000 (11:33 +0200)
zebra should only check whether a get_chunk operation succeeded
when processing the response, rather than insde the get_chunk
call itself. Spllitting the request and response hooks was done
precisely to allow for asynchronous calls to an external label
manager; in this case, the requested chunk is not necessarily
going to be available at request time.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
zebra/label_manager.c
zebra/zapi_msg.c

index 0825fb55caa2664c1d2b8625e95513082f31d729..5f2128a09c0c13412233b017aa017d69df1fa60c 100644 (file)
@@ -446,6 +446,15 @@ int lm_client_connect_response(uint8_t proto, uint16_t instance,
 int lm_get_chunk_response(struct label_manager_chunk *lmc, uint8_t proto,
                          uint16_t instance, 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(proto), 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(proto),
+                          instance);
+
        struct zserv *client = zserv_find_client(proto, instance);
        if (!client) {
                zlog_err("%s: could not find client for daemon %s instance %u",
index aabe533ee69639cbe26227ba1e136c8214bb1a2e..a58df826984180487ceb648ec4e4ee3759bb933f 100644 (file)
@@ -2225,17 +2225,6 @@ static void zread_get_label_chunk(struct zserv *client, struct stream *msg,
        /* call hook to get a chunk using wrapper */
        lm_get_chunk_call(&lmc, proto, instance, keep, size, base, vrf_id);
 
-       if (!lmc)
-               flog_err(
-                       EC_ZEBRA_LM_CANNOT_ASSIGN_CHUNK,
-                       "Unable to assign Label Chunk of size %u to %s instance %u",
-                       size, zebra_route_string(proto), 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(proto), instance);
-
 stream_failure:
        return;
 }