Skip to contentSkip to conversation

Fixed client hang when server don't PUSH (aka the NO_SOUP_FOR_YOU patch)

PATCH In review David Sommerseth 1 participant 2 messages Jun 12, 2010 – Jun 20, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fixed client hang when server don't PUSH (aka the NO_SOUP_FOR_YOU patch)

From: David Sommerseth <[email protected]...>

Solves bug ticket 13
<https://community.openvpn.net/openvpn/ticket/13>

When the client sends PUSH_REQUESTS, it waits until the server sends PUSH_REPLY. If the server do not have anything to push to the client nothing happens. The client will then regularly send new PUSH_REQUESTS until it gets an answer, which results in not completing the connection negotiation.

This patch makes the server send an empty PUSH_REPLY when it has nothing to more to push to the client.

---
 push.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
push.c +17 -0
index 9ddc900..1320bec 100644
@@ -177,6 +177,7 @@ send_push_reply (struct context *c)
   static char cmd[] = "PUSH_REPLY";
   const int extra = 64; /* extra space for possible trailing ifconfig and push-continuation */
   const int safe_cap = BCAP (&buf) - extra;
+  bool push_sent = false;
 
   buf_printf (&buf, cmd);
 
@@ -192,6 +193,7 @@ send_push_reply (struct context *c)
 		const bool status = send_control_channel_string (c, BSTR (&buf), D_PUSH);
 		if (!status)
 		  goto fail;
+		push_sent = true;
 		multi_push = true;
 		buf_reset_len (&buf);
 		buf_printf (&buf, cmd);
@@ -218,6 +220,21 @@ send_push_reply (struct context *c)
     {
       const bool status = send_control_channel_string (c, BSTR (&buf), D_PUSH);
       if (!status)
+        goto fail;
+      push_sent = true;
+    }
+
+  /* If nothing have been pushed, send an empty push,
+   * as the client is expecting a response
+   */
+  if (!push_sent)
+    {
+      bool status = false;
+
+      buf_reset_len (&buf);
+      buf_printf (&buf, cmd);
+      status = send_control_channel_string (c, BSTR(&buf), D_PUSH);
+      if (!status)
 	goto fail;
     }
 
Signature · 1 line
1.6.6.1
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 10 lines · David Sommerseth

From: David Sommerseth <[email protected]...>

Solves bug ticket 13
<https://community.openvpn.net/openvpn/ticket/13>

When the client sends PUSH_REQUESTS, it waits until the server sends PUSH_REPLY. If the server do not have anything to push to the client nothing happens. The client will then regularly send new PUSH_REQUESTS until it gets an answer, which results in not completing the connection negotiation.

Quoted 4 lines

This patch makes the server send an empty PUSH_REPLY when it has nothing to more to push to the client.

Acked by James Yonan in the IRC meeting June 17.

Commit cb56a3ebe65871ae37894503e35c0b3703ee17a5, applied to bugfix2.1 and merged into allmerged.

Kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkwdqAgACgkQDC186MBRfrplPACgqn/6hqvvQYWqi2Ebmhw9GzgC +eAAmwcQK7TsTr0mxvRL8GB37ZmuNEzY
=mWyI
-----END PGP SIGNATURE-----