]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fixup version command on management interface
authorSelva Nair <selva.nair@gmail.com>
Tue, 24 Feb 2026 21:30:30 +0000 (22:30 +0100)
committerGert Doering <gert@greenie.muc.de>
Wed, 25 Feb 2026 08:39:41 +0000 (09:39 +0100)
All commands to the management interface are supposed to be
responded with either a one-line "SUCCESS:/ERROR:" message
or a multi-line reply terminated by "END". But, curently we
silently accept the "version n" command wih no response. This
causes clients like OpenVPN-GUI lock-up if version command is
used, waiting for ever for a reply.

Fix this by adding a SUCCESS response if client version
is set to a value >= 4. As the highest client version in use
until now is 3, this should not affect any work-arounds in
existing clients. ERROR response is generated if the version
parameter is null which never happens in practice.

Change-Id: I76dc80a9d9b29e401b7bbd59e0c46baf751d2e4a
Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1528
Message-Id: <20260224213036.31845-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35782.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
doc/management-notes.txt
src/openvpn/manage.c

index 1a5c311cce1b0e07797d6a67136f73c367936670..86b74f33673cfac7af023796df0c2a1a99304ba1 100644 (file)
@@ -492,6 +492,10 @@ Command examples:
   version 2  -- Change management version of client to 2 (default = 1)
   version    -- Show the version of OpenVPN and its Management Interface
 
+Note: Until version 3, no response was generated when client sets its
+version. This was fixed starting version 4: clients should expect
+"SUCCESS: .. " message only when setting the version to >= 4.
+
 COMMAND -- auth-retry
 ---------------------
 
index 37ae6b381f89d24d68d7ceb9332b1990bc1ae57e..03ff5b3774057d96555a2def9344c5c4ef01058a 100644 (file)
@@ -1333,6 +1333,15 @@ set_client_version(struct management *man, const char *version)
     if (version)
     {
         man->connection.client_version = atoi(version);
+        /* Prior to version 3, we missed to respond to this command. Acknowledge only if version >= 4 */
+        if (man->connection.client_version >= 4)
+        {
+            msg(M_CLIENT, "SUCCESS: Management client version set to %d", man->connection.client_version);
+        }
+    }
+    else
+    {
+        msg(M_CLIENT, "ERROR: Invalid value specified for management client version");
     }
 }