From 9b5aba4a553f485651e893ab202eb62721ddb1d9 Mon Sep 17 00:00:00 2001 From: Ycarus Date: Thu, 15 Nov 2018 14:33:59 +0000 Subject: [PATCH] Littles fixes --- omr-admin.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/omr-admin.py b/omr-admin.py index a84116b..b525ae5 100644 --- a/omr-admin.py +++ b/omr-admin.py @@ -192,11 +192,13 @@ def mptcp(): scheduler = params.get('scheduler', None) syn_retries = params.get('syn_retries', None) congestion_control = params.get('congestion_control', None) - os.system('sysctl -w net.mptcp.mptcp_checksum='+checksum) - os.system('sysctl -w net.mptcp.mptcp_path_manager='+path_manager) - os.system('sysctl -w net.mptcp.mptcp_scheduler='+scheduler) - os.system('sysctl -w net.mptcp.mptcp_syn_retries='+syn_retries) - os.system('sysctl -w net.ipv4.tcp_congestion_control='+congestion_control) + if not checksum or not path_manager or not scheduler or not syn_retries or not congestion_control: + return jsonify({'result': 'error','reason': 'Invalid parameters'}) + os.system('sysctl -w net.mptcp.mptcp_checksum=' + checksum) + os.system('sysctl -w net.mptcp.mptcp_path_manager=' + path_manager) + os.system('sysctl -w net.mptcp.mptcp_scheduler=' + scheduler) + os.system('sysctl -w net.mptcp.mptcp_syn_retries=' + syn_retries) + os.system('sysctl -w net.ipv4.tcp_congestion_control=' + congestion_control) return jsonify({'result': 'done'})