Commit 4d8454f9 authored by Killian Lufau's avatar Killian Lufau

Fix UDP option for OpenVPN 2.4.7

parent 96ab35a9
......@@ -23,10 +23,12 @@ def openvpn(iface, encrypt, *args, **kw):
logging.debug('%r', args)
return utils.Popen(args, **kw)
ovpn_link_mtu_dict = {'udp': 1432, 'udp6': 1450}
ovpn_link_mtu_dict = {'udp4': 1432, 'udp6': 1450}
def server(iface, max_clients, dh_path, fd, port, proto, encrypt, *args, **kw):
client_script = '%s %s' % (ovpn_server, fd)
if proto == 'udp':
proto='udp4'
try:
args = ('--link-mtu', str(ovpn_link_mtu_dict[proto]),
# mtu-disc ignored for udp6 due to a bug in OpenVPN
......@@ -50,6 +52,8 @@ def client(iface, address_list, encrypt, *args, **kw):
# XXX: We'd like to pass <connection> sections at command-line.
link_mtu = set()
for ip, port, proto in address_list:
if proto == 'udp':
proto = 'udp4'
remote += '--remote', ip, port, proto
link_mtu.add(ovpn_link_mtu_dict.get(proto))
link_mtu, = link_mtu
......
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