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>
... | ... |
@@ -696,7 +696,7 @@ tunnel_server_tcp (struct context *top) |
696 | 696 |
multi_init (&multi, top, true, MC_SINGLE_THREADED); |
697 | 697 |
|
698 | 698 |
/* initialize our cloned top object */ |
699 |
- multi_top_init (&multi, top, true); |
|
699 |
+ multi_top_init (&multi, top); |
|
700 | 700 |
|
701 | 701 |
/* initialize management interface */ |
702 | 702 |
init_management_callback_multi (&multi); |
... | ... |
@@ -283,7 +283,7 @@ tunnel_server_udp_single_threaded (struct context *top) |
283 | 283 |
multi_init (&multi, top, false, MC_SINGLE_THREADED); |
284 | 284 |
|
285 | 285 |
/* initialize our cloned top object */ |
286 |
- multi_top_init (&multi, top, true); |
|
286 |
+ multi_top_init (&multi, top); |
|
287 | 287 |
|
288 | 288 |
/* initialize management interface */ |
289 | 289 |
init_management_callback_multi (&multi); |
... | ... |
@@ -2859,12 +2859,10 @@ multi_process_per_second_timers_dowork (struct multi_context *m) |
2859 | 2859 |
} |
2860 | 2860 |
|
2861 | 2861 |
void |
2862 |
-multi_top_init (struct multi_context *m, const struct context *top, const bool alloc_buffers) |
|
2862 |
+multi_top_init (struct multi_context *m, const struct context *top) |
|
2863 | 2863 |
{ |
2864 | 2864 |
inherit_context_top (&m->top, top); |
2865 |
- m->top.c2.buffers = NULL; |
|
2866 |
- if (alloc_buffers) |
|
2867 |
- m->top.c2.buffers = init_context_buffers (&top->c2.frame); |
|
2865 |
+ m->top.c2.buffers = init_context_buffers (&top->c2.frame); |
|
2868 | 2866 |
} |
2869 | 2867 |
|
2870 | 2868 |
void |
... | ... |
@@ -233,7 +233,7 @@ const char *multi_instance_string (const struct multi_instance *mi, bool null, s |
233 | 233 |
void multi_init (struct multi_context *m, struct context *t, bool tcp_mode, int thread_mode); |
234 | 234 |
void multi_uninit (struct multi_context *m); |
235 | 235 |
|
236 |
-void multi_top_init (struct multi_context *m, const struct context *top, const bool alloc_buffers); |
|
236 |
+void multi_top_init (struct multi_context *m, const struct context *top); |
|
237 | 237 |
void multi_top_free (struct multi_context *m); |
238 | 238 |
|
239 | 239 |
struct multi_instance *multi_create_instance (struct multi_context *m, const struct mroute_addr *real); |