]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: mgmtd: session create and destroy both short-circuit
authorChristian Hopps <chopps@labn.net>
Mon, 12 Jun 2023 02:13:48 +0000 (22:13 -0400)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Thu, 22 Jun 2023 21:56:44 +0000 (21:56 +0000)
For creation this is the first thing done so short-circuit just means inline
sync response. However, for destroy there could be commands in-flight, these
will be discarded when they match no session, and the state cleaned up
immediately when the message short-circuits.

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 0fc08fa7381fdba03a0c2e5b745929954172915a)

lib/mgmt_fe_client.c

index 35a6d7d90955cf7877dbdfacbb329a6b6835337f..7af421405b72499ee15d35948e372f8d990e9f07 100644 (file)
@@ -124,18 +124,15 @@ static int mgmt_fe_send_session_req(struct mgmt_fe_client *client,
 {
        Mgmtd__FeMessage fe_msg;
        Mgmtd__FeSessionReq sess_req;
-       bool scok;
 
        mgmtd__fe_session_req__init(&sess_req);
        sess_req.create = create;
        if (create) {
                sess_req.id_case = MGMTD__FE_SESSION_REQ__ID_CLIENT_CONN_ID;
                sess_req.client_conn_id = session->client_id;
-               scok = true;
        } else {
                sess_req.id_case = MGMTD__FE_SESSION_REQ__ID_SESSION_ID;
                sess_req.session_id = session->session_id;
-               scok = false;
        }
 
        mgmtd__fe_message__init(&fe_msg);
@@ -146,7 +143,7 @@ static int mgmt_fe_send_session_req(struct mgmt_fe_client *client,
                "Sending SESSION_REQ %s message for client-id %" PRIu64,
                create ? "create" : "destroy", session->client_id);
 
-       return mgmt_fe_client_send_msg(client, &fe_msg, scok);
+       return mgmt_fe_client_send_msg(client, &fe_msg, true);
 }
 
 int mgmt_fe_send_lockds_req(struct mgmt_fe_client *client, uint64_t session_id,