Skip to contentSkip to conversation

Fix #ifdefs for P2MP_SERVER

PATCH Superseded Arne Schwabe 2 participants 9 messages May 30, 2013 – Nov 15, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix #ifdefs for P2MP_SERVER

---
 src/openvpn/ssl.c        |    2 +-
 src/openvpn/ssl_common.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
src/openvpn/ssl.c +1 -1
index 12da365..088eea8 100644
@@ -2043,7 +2043,7 @@ key_method_2_read (struct buffer *buf, struct tls_multi *multi, struct tls_sessi
   username_status = read_string (buf, up->username, USER_PASS_LEN);
   password_status = read_string (buf, up->password, USER_PASS_LEN);
 
-#ifdef P2MP_SERVER
+#if P2MP_SERVER
   /* get peer info from control channel */
   free (multi->peer_info);
   multi->peer_info = read_string_alloc (buf);
src/openvpn/ssl_common.h +1 -1
index 06ce0dd..7e52f9a 100644
@@ -485,7 +485,7 @@ struct tls_multi
   time_t tas_last;
 #endif
 
-#ifdef P2MP_SERVER
+#if P2MP_SERVER
   /*
    * A multi-line string of general-purpose info received from peer
    * over control channel.
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/1 Fix #ifdefs for P2MP_SERVER

---
 src/openvpn/ssl.c        |    2 +-
 src/openvpn/ssl_common.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
src/openvpn/ssl.c +1 -1
index 12da365..088eea8 100644
@@ -2043,7 +2043,7 @@ key_method_2_read (struct buffer *buf, struct tls_multi *multi, struct tls_sessi
   username_status = read_string (buf, up->username, USER_PASS_LEN);
   password_status = read_string (buf, up->password, USER_PASS_LEN);
 
-#ifdef P2MP_SERVER
+#if P2MP_SERVER
   /* get peer info from control channel */
   free (multi->peer_info);
   multi->peer_info = read_string_alloc (buf);
src/openvpn/ssl_common.h +1 -1
index 06ce0dd..7e52f9a 100644
@@ -485,7 +485,7 @@ struct tls_multi
   time_t tas_last;
 #endif
 
-#ifdef P2MP_SERVER
+#if P2MP_SERVER
   /*
    * A multi-line string of general-purpose info received from peer
    * over control channel.
Signature · 1 line
1.7.9.5
#2 lore raw

Hi,

Review

Quoted 2 lines · Arne Schwabe
(quoted diff) +1 -1
-#ifdef P2MP_SERVER
+#if P2MP_SERVER

ACK. Sorry for overlooking that.

(For the rest of the audience: P2MP_SERVER is one of the #define-s that is always #define'd - it's either "#define P2MP_SERVER 1" or "... 0", so with #ifdef, it will always be matched)

Will commit ASAP.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#3 lore raw

PATCH 1/1 Add reporting of UI version to basic push-peer-info set.

In reply to Gert Doering

If a GUIs sets IV_OPENVPN_GUI_VERSION the version will be pushed to the server.

Also fix implicit declaration of function 'multi_output_peer_info_env' by including multi.h into ssl.c

---
 src/openvpn/ssl.c |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
src/openvpn/ssl.c +10 -7
index 088eea8..8790675 100644
@@ -67,6 +67,7 @@
 #include "ssl.h"
 #include "ssl_verify.h"
 #include "ssl_backend.h"
+#include "multi.h"
 
 #include "memdbg.h"
 
@@ -1817,15 +1818,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);
 	    }
 	}
 
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 1/1 Fix another #ifdef/#if P2MP_SERVER

In reply to Gert Doering
---
 src/openvpn/ssl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/ssl.c +1 -1
index 088eea8..d9076f3 100644
@@ -1107,7 +1107,7 @@ tls_multi_free (struct tls_multi *multi, bool clear)
   man_def_auth_set_client_reason(multi, NULL);  
 
 #endif
-#ifdef P2MP_SERVER
+#if P2MP_SERVER
   free (multi->peer_info);
 #endif
 
Signature · 1 line
1.7.9.5
#6 lore raw

[Openvpn-devel] [PATCH applied] Re: Fix another #ifdef/#if P2MP_SERVER

ACK.

Patch has been applied to the master branch.

commit 0a48ae367f4de3d95c99dc0f1668ea0308205ed5 (master)

Author: Arne Schwabe
Date:   Fri May 31 17:26:32 2013 +0200
     Fix another #ifdef/#if P2MP_SERVER

     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: http://article.gmane.org/gmane.network.openvpn.devel/7647
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#4 lore raw

[Openvpn-devel] [PATCH applied] Re: Add reporting of UI version to basic push-peer-info set.

In reply to Arne Schwabe

ACK (by James and me, in one of the IRC Meetings and on the Hackathon).

Your patch has been applied to the master and release/2.3 branches.

commit f3a2cd255a3bc73a546a5e2d09fa30a16cce0d7d (master) commit ca2c4a9da769ceefd7e79829362ed054f667536b (master)

Author: Arne Schwabe
Date:   Fri May 31 14:59:35 2013 +0200
     Add reporting of UI version to basic push-peer-info set.

     Signed-off-by: Arne Schwabe <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Acked-by: James Yonan <[email protected]...>
     Message-Id: <[email protected]...>
     URL: http://article.gmane.org/gmane.network.openvpn.devel/7646
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering