Commit 7d4346a9 authored by Julien Muchembled's avatar Julien Muchembled

Remove \t from upnpigd.py

parent ae92b1eb
...@@ -3,17 +3,17 @@ import socket ...@@ -3,17 +3,17 @@ import socket
# return (address, port) # return (address, port)
def ForwardViaUPnP(localPort): def ForwardViaUPnP(localPort):
u = miniupnpc.UPnP() u = miniupnpc.UPnP()
u.discoverdelay = 200 u.discoverdelay = 200
u.discover() u.discover()
u.selectigd() u.selectigd()
externalPort = 1194 externalPort = 1194
while True: while True:
while u.getspecificportmapping(externalPort, 'UDP') != None: while u.getspecificportmapping(externalPort, 'UDP') != None:
externalPort = max(externalPort + 1, 49152) externalPort = max(externalPort + 1, 49152)
if externalPort == 65536: if externalPort == 65536:
raise Exception raise Exception
if u.addportmapping(externalPort, 'UDP', u.lanaddr, localPort, 'Vifib openvpn server', ''): if u.addportmapping(externalPort, 'UDP', u.lanaddr, localPort, 'Vifib openvpn server', ''):
return (u.externalipaddress(), externalPort) return (u.externalipaddress(), externalPort)
# TODO : specify a lease duration # TODO : specify a lease duration
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