Instead of limiting the control channel TCP/UDP packet payload size at
'100 bytes + real control channel overhead' (~140 bytes ethernet payload),
increase the max TCP/UDP payload size to '1250 bytes - calculated overhead'
(~1210 bytes ethernet payload).
Note that this patch does *not* yield an optimal solution, but it is a
simple and rather safe change that will improve connection setup times
significantly.
v2: use the mininum value of --link-mtu and 1250 to give the user a way to
reduce control packet size if really needed.
trac #545
Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1435693496-10931-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9841
Signed-off-by: Gert Doering <gert@greenie.muc.de>
... | ... |
@@ -298,8 +298,9 @@ tls_init_control_channel_frame_parameters(const struct frame *data_channel_frame |
298 | 298 |
reliable_ack_adjust_frame_parameters (frame, CONTROL_SEND_ACK_MAX); |
299 | 299 |
frame_add_to_extra_frame (frame, SID_SIZE + sizeof (packet_id_type)); |
300 | 300 |
|
301 |
- /* set dynamic link MTU to minimum value */ |
|
302 |
- frame_set_mtu_dynamic (frame, 0, SET_MTU_TUN); |
|
301 |
+ /* set dynamic link MTU to cap control channel packets at 1250 bytes */ |
|
302 |
+ ASSERT (TUN_LINK_DELTA (frame) < min_int (frame->link_mtu, 1250)); |
|
303 |
+ frame->link_mtu_dynamic = min_int (frame->link_mtu, 1250) - TUN_LINK_DELTA (frame); |
|
303 | 304 |
} |
304 | 305 |
|
305 | 306 |
void |