aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteffan Karger2016-06-08 14:20:40 +0200
committerGert Doering2016-06-08 19:55:53 +0200
commitd92718141287a0f9adcffec5c2fa7d76213162cc (patch)
tree40bdbd416c8d3db79392a28114667ce4a9fe7f85
parent3c1b19e04745177185decd14da82c71458442b82 (diff)
downloadopenvpn-d92718141287a0f9adcffec5c2fa7d76213162cc.zip
openvpn-d92718141287a0f9adcffec5c2fa7d76213162cc.tar.gz
cleanup: remove alloc_buffers argument from multi_top_init()
multi_top_init() is always called with alloc_buffers=true, so just remove the argument and alloc unconditionally. Signed-off-by: Steffan Karger <steffan@karger.me> Acked-by: Arne Schwabe <arne@rfc2549.org> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <1465388443-15484-3-git-send-email-steffan@karger.me> URL: http://article.gmane.org/gmane.network.openvpn.devel/11851 Signed-off-by: Gert Doering <gert@greenie.muc.de>
-rw-r--r--src/openvpn/mtcp.c2
-rw-r--r--src/openvpn/mudp.c2
-rw-r--r--src/openvpn/multi.c6
-rw-r--r--src/openvpn/multi.h2
4 files changed, 5 insertions, 7 deletions
diff --git a/src/openvpn/mtcp.c b/src/openvpn/mtcp.c
index 9926d47..78e5ccd 100644
--- a/src/openvpn/mtcp.c
+++ b/src/openvpn/mtcp.c
@@ -696,7 +696,7 @@ tunnel_server_tcp (struct context *top)
multi_init (&multi, top, true, MC_SINGLE_THREADED);
/* initialize our cloned top object */
- multi_top_init (&multi, top, true);
+ multi_top_init (&multi, top);
/* initialize management interface */
init_management_callback_multi (&multi);
diff --git a/src/openvpn/mudp.c b/src/openvpn/mudp.c
index ce67206..6e0568e 100644
--- a/src/openvpn/mudp.c
+++ b/src/openvpn/mudp.c
@@ -283,7 +283,7 @@ tunnel_server_udp_single_threaded (struct context *top)
multi_init (&multi, top, false, MC_SINGLE_THREADED);
/* initialize our cloned top object */
- multi_top_init (&multi, top, true);
+ multi_top_init (&multi, top);
/* initialize management interface */
init_management_callback_multi (&multi);
diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c
index 4c43fcc..ba7f2c0 100644
--- a/src/openvpn/multi.c
+++ b/src/openvpn/multi.c
@@ -2859,12 +2859,10 @@ multi_process_per_second_timers_dowork (struct multi_context *m)
}
void
-multi_top_init (struct multi_context *m, const struct context *top, const bool alloc_buffers)
+multi_top_init (struct multi_context *m, const struct context *top)
{
inherit_context_top (&m->top, top);
- m->top.c2.buffers = NULL;
- if (alloc_buffers)
- m->top.c2.buffers = init_context_buffers (&top->c2.frame);
+ m->top.c2.buffers = init_context_buffers (&top->c2.frame);
}
void
diff --git a/src/openvpn/multi.h b/src/openvpn/multi.h
index ec1e7ab..9d8185d 100644
--- a/src/openvpn/multi.h
+++ b/src/openvpn/multi.h
@@ -233,7 +233,7 @@ const char *multi_instance_string (const struct multi_instance *mi, bool null, s
void multi_init (struct multi_context *m, struct context *t, bool tcp_mode, int thread_mode);
void multi_uninit (struct multi_context *m);
-void multi_top_init (struct multi_context *m, const struct context *top, const bool alloc_buffers);
+void multi_top_init (struct multi_context *m, const struct context *top);
void multi_top_free (struct multi_context *m);
struct multi_instance *multi_create_instance (struct multi_context *m, const struct mroute_addr *real);