aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn/mudp.c
diff options
context:
space:
mode:
authorLev Stipakov2014-12-08 18:48:45 +0200
committerDavid Sommerseth2014-12-08 22:18:20 +0100
commit09cf2ec5c09d35c72f2af0d988de8152378a182a (patch)
tree03f46da3e6d4ede396b428e28c20f005dcdf3ab6 /src/openvpn/mudp.c
parent1b9541922ad6ff6ee46c84f43cd23b7064f7919d (diff)
downloadopenvpn-09cf2ec5c09d35c72f2af0d988de8152378a182a.zip
openvpn-09cf2ec5c09d35c72f2af0d988de8152378a182a.tar.gz
Prevent memory drain for long lasting floating sessions
For every float event we generate prefix, which allocates 256 + 64 bytes. That memory is reclaimed when client disconnects, so long lasting and constantly floating sessions drain memory. As a fix use preallocated buffer inside multi_instance for storing multi_prefix. Signed-off-by: Lev Stipakov <lstipakov@gmail.com> Acked-by: Steffan Karger <steffan.karger@fox-it.com> Message-Id: 1418057325-13265-1-git-send-email-lstipakov@gmail.com URL: http://article.gmane.org/gmane.network.openvpn.devel/9321 Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'src/openvpn/mudp.c')
-rw-r--r--src/openvpn/mudp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/openvpn/mudp.c b/src/openvpn/mudp.c
index 853c08c..3e3f750 100644
--- a/src/openvpn/mudp.c
+++ b/src/openvpn/mudp.c
@@ -111,6 +111,10 @@ multi_get_create_instance_udp (struct multi_context *m, bool *floated)
break;
}
}
+
+ /* should not really end up here, since multi_create_instance returns null
+ * if amount of clients exceeds max_clients */
+ ASSERT(i < m->max_clients);
}
}
else