]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Add reporting of UI version to basic push-peer-info set.
authorArne Schwabe <arne@rfc2549.org>
Fri, 31 May 2013 12:59:35 +0000 (14:59 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 15 Nov 2013 13:39:38 +0000 (14:39 +0100)
If a GUIs sets IV_OPENVPN_GUI_VERSION the version will be pushed to the
server.

Usage convention for IV_OPENVPN_GUI_VERSION is "<gui_id><space><version>",
for example "de.blinkt.openvpn 0.5.47" for the ICS Android version.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: James Yonan <james@openvpn.net>
Message-Id: <1370005175-14871-1-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7646
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/ssl.c

index 69f77f3bbdaade0da59b6a2d714070ba1692bf56..58ba238478e12e5be84d34c789b9f2d1967dca7a 100644 (file)
@@ -1834,15 +1834,17 @@ push_peer_info(struct buffer *buf, struct tls_session *session)
          get_default_gateway (&rgi);
          if (rgi.flags & RGI_HWADDR_DEFINED)
            buf_printf (&out, "IV_HWADDR=%s\n", format_hex_ex (rgi.hwaddr, 6, 0, 1, ":", &gc));
+        }
 
-         /* push env vars that begin with UV_ */
-         for (e=es->list; e != NULL; e=e->next)
+      /* push env vars that begin with UV_ and IV_OPENVPN_GUI_VERSION */
+      for (e=es->list; e != NULL; e=e->next)
+       {
+         if (e->string)
            {
-             if (e->string)
-               {
-                 if (!strncmp(e->string, "UV_", 3) && buf_safe(&out, strlen(e->string)+1))
-                   buf_printf (&out, "%s\n", e->string);
-               }
+             if (((strncmp(e->string, "UV_", 3)==0 && session->opt->push_peer_info_detail >= 2)
+                  || (strncmp(e->string,"IV_OPENVPN_GUI_VERSION=",sizeof("IV_OPENVPN_GUI_VERSION=")-1)==0))
+                 && buf_safe(&out, strlen(e->string)+1))
+               buf_printf (&out, "%s\n", e->string);
            }
        }