Commit d398aa93 authored by Killian Lufau's avatar Killian Lufau Committed by Julien Muchembled

OpenVPN 2.4.7 workaround to revert to previous MTU settings

In commit 06974788,
we increased the --link-mtu value as a temporary way to compensate the
unexplained behaviour change of recent OpenVPN.

This was partly due to encryption, which was enabled despite
`--cipher none`. And it happens that the behaviour of --link-mtu only
changed for the server, with a mysterious difference of 93 bytes.

Hence the workaround to get identical tunnel MTU on both sides.

/reviewed-on !13
parent 24fea8cd
......@@ -22,14 +22,14 @@ def openvpn(iface, encrypt, *args, **kw):
logging.debug('%r', args)
return utils.Popen(args, **kw)
ovpn_link_mtu_dict = {'udp4': 1500, 'udp6': 1500}
ovpn_link_mtu_dict = {'udp4': 1432, 'udp6': 1450}
def server(iface, max_clients, dh_path, fd, port, proto, encrypt, *args, **kw):
if proto == 'udp':
proto = 'udp4'
client_script = '%s %s' % (ovpn_server, fd)
try:
args = ('--link-mtu', str(ovpn_link_mtu_dict[proto]),
args = ('--link-mtu', str(ovpn_link_mtu_dict[proto] + 93),
'--mtu-disc', 'yes') + args
except KeyError:
proto += '-server'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment