[Openvpn-devel] Remove useless empty line from CR_RESPONSE message

Message ID 20220530224149.201883-1-arne@rfc2549.org
State Accepted
Headers show
Series [Openvpn-devel] Remove useless empty line from CR_RESPONSE message | expand

Commit Message

Arne Schwabe May 30, 2022, 10:41 p.m. UTC
The out buffer is not filled and this adds an extra empty line for
CR_RESPONSE outputs. Also make minor style fixes.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
---
 src/openvpn/manage.c | 5 +----
 src/openvpn/push.c   | 1 -
 2 files changed, 1 insertion(+), 5 deletions(-)

Comments

Gert Doering May 31, 2022, 11:48 a.m. UTC | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

"Obviously correct".  Didn't want to go in (the push.c hunk has an
ENABLE_PLUGIN in the context, which is not in master), but that was
easy to fix.

Lightly "make check" tested.

Your patch has been applied to the master and release/2.5 branch.

commit 0dbcaba4f301c21e68a5cd032a4b56eb75c17c37 (master)
commit 400da02714abd36218954c988a2ef81dade0b59d (release/2.5)
Author: Arne Schwabe
Date:   Tue May 31 00:41:49 2022 +0200

     Remove useless empty line from CR_RESPONSE message

     Signed-off-by: Arne Schwabe <arne@rfc2549.org>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20220530224149.201883-1-arne@rfc2549.org>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24447.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c
index 9c07bf298..edcf0f202 100644
--- a/src/openvpn/manage.c
+++ b/src/openvpn/manage.c
@@ -2883,17 +2883,14 @@  management_notify_client_cr_response(unsigned mda_key_id,
     {
         gc = gc_new();
 
-        struct buffer out = alloc_buf_gc(256, &gc);
         msg(M_CLIENT, ">CLIENT:CR_RESPONSE,%lu,%u,%s",
             mdac->cid, mda_key_id, response);
         man_output_extra_env(management, "CLIENT");
-        if (management->connection.env_filter_level>0)
+        if (management->connection.env_filter_level > 0)
         {
             man_output_peer_info_env(management, mdac);
         }
         man_output_env(es, true, management->connection.env_filter_level, "CLIENT");
-        management_notify_generic(management, BSTR(&out));
-
         gc_free(&gc);
     }
 }
diff --git a/src/openvpn/push.c b/src/openvpn/push.c
index 7cf882d11..2332bc464 100644
--- a/src/openvpn/push.c
+++ b/src/openvpn/push.c
@@ -249,7 +249,6 @@  receive_cr_response(struct context *c, const struct buffer *buffer)
     struct env_set *es = session->opt->es;
     int key_id = get_primary_key(c->c2.tls_multi)->key_id;
 
-
     management_notify_client_cr_response(key_id, mda, es, m);
 #endif
 #if ENABLE_PLUGIN