Commit 03e3061a authored by Guillaume Bury's avatar Guillaume Bury

Fixed ip length problem in openvpn server

parent b9f25552
......@@ -15,10 +15,6 @@ To be done :
Use an algorithm to choose which connections to keep and/or establish
instead of pure randomness
Find a name for the project : the projet is ( or should be ) independant
from vifib, openvpn, babel, and so should the name; btw we aim to build a
distributed, scalable, resilient VPN.... ( if it helps with the name )
Replace comments at the beginning of functions with docstrings & give all
fn docstrings
......@@ -34,6 +30,9 @@ To be done :
( avahi could be used )
To be discussed:
Ideas for the name :
CON ( cloud overlay network ), cloudnet. From J.P -> already taken
G, J : To get traffic stats ( bytes in/out ), you can use
/sys/class/net/interface/statistics/rx_bytes, etc...
or /proc/net/dev/snmp6/interface ( all in one file ). This can be enough
......
......@@ -17,12 +17,12 @@ def openvpn(hello_interval, *args, **kw):
utils.log(str(args), 5)
return subprocess.Popen(args, **kw)
def server(server_ip, network, max_clients, dh_path, pipe_fd, port, proto, hello_interval, *args, **kw):
def server(server_ip, ip_length, max_clients, dh_path, pipe_fd, port, proto, hello_interval, *args, **kw):
utils.log('Starting server', 3)
return openvpn(hello_interval,
'--tls-server',
'--mode', 'server',
'--up', 'ovpn-server %s/%u' % (server_ip, len(network)),
'--up', 'ovpn-server %s/%u' % (server_ip, ip_length),
'--client-connect', 'ovpn-server ' + str(pipe_fd),
'--client-disconnect', 'ovpn-server ' + str(pipe_fd),
'--dh', dh_path,
......
......@@ -122,7 +122,7 @@ def main():
os.O_WRONLY|os.O_CREAT|os.O_TRUNC), stderr=subprocess.STDOUT)
# Establish connections
server_process = list(plib.server(internal_ip, network,
server_process = list(plib.server(internal_ip, len(network) + len(prefix),
config.connection_count, config.dh, write_pipe, config.internal_port,
proto, config.hello, '--dev', 'vifibnet', *openvpn_args,
stdout=os.open(os.path.join(config.log,
......
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