1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-vps-admin.git synced 2025-03-09 15:40:05 +00:00

Fix syn_retries set

This commit is contained in:
Ycarus 2020-02-19 19:29:17 +01:00
parent 860a0ab51c
commit 4ed9794b3c

View file

@ -63,6 +63,7 @@ def get_bytes(t, iface='eth0'):
def get_bytes_ss(port): def get_bytes_ss(port):
ss_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM); ss_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM);
ss_socket.settimeout(3)
ss_socket.sendto('ping'.encode(), ("127.0.0.1",8839)); ss_socket.sendto('ping'.encode(), ("127.0.0.1",8839));
ss_recv = ss_socket.recv(1024); ss_recv = ss_socket.recv(1024);
json_txt = ss_recv.decode("utf-8").replace('stat: ',''); json_txt = ss_recv.decode("utf-8").replace('stat: ','');
@ -954,7 +955,7 @@ def mptcp(*, params: MPTCPparams,current_user: User = Depends(get_current_user))
os.system('sysctl -qw net.mptcp.mptcp_checksum=' + checksum) os.system('sysctl -qw net.mptcp.mptcp_checksum=' + checksum)
os.system('sysctl -qw net.mptcp.mptcp_path_manager=' + path_manager) os.system('sysctl -qw net.mptcp.mptcp_path_manager=' + path_manager)
os.system('sysctl -qw net.mptcp.mptcp_scheduler=' + scheduler) os.system('sysctl -qw net.mptcp.mptcp_scheduler=' + scheduler)
os.system('sysctl -qw net.mptcp.mptcp_syn_retries=' + syn_retries) os.system('sysctl -qw net.mptcp.mptcp_syn_retries=' + str(syn_retries))
os.system('sysctl -qw net.ipv4.tcp_congestion_control=' + congestion_control) os.system('sysctl -qw net.ipv4.tcp_congestion_control=' + congestion_control)
set_lastchange() set_lastchange()
return {'result': 'done','reason': 'changes applied'} return {'result': 'done','reason': 'changes applied'}