From 7618a842d54eade58007ab72c751b1f1a900f840 Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 10 May 2017 15:54:56 -0400 Subject: Add OpenVPN GUI Option for "sndbuf" and "rcvbuf", using the same value for both. Fixes #7507 --- src/usr/local/www/vpn_openvpn_client.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/usr/local/www/vpn_openvpn_client.php') diff --git a/src/usr/local/www/vpn_openvpn_client.php b/src/usr/local/www/vpn_openvpn_client.php index 4b566a9..f0c612c 100644 --- a/src/usr/local/www/vpn_openvpn_client.php +++ b/src/usr/local/www/vpn_openvpn_client.php @@ -164,6 +164,7 @@ if ($act == "edit") { $pconfig['compression'] = $a_client[$id]['compression']; $pconfig['passtos'] = $a_client[$id]['passtos']; $pconfig['udp_fast_io'] = $a_client[$id]['udp_fast_io']; + $pconfig['sndrcvbuf'] = $a_client[$id]['sndrcvbuf']; $pconfig['topology'] = $a_client[$id]['topology']; // just in case the modes switch @@ -360,6 +361,10 @@ if ($_POST['save']) { } } + if (!empty($pconfig['sndrcvbuf']) && !array_key_exists($pconfig['sndrcvbuf'], openvpn_get_buffer_values())) { + $input_errors[] = gettext("The supplied Send/Receive Buffer size is invalid."); + } + if (!$input_errors) { $client = array(); @@ -434,6 +439,7 @@ if ($_POST['save']) { $client['compression'] = $pconfig['compression']; $client['passtos'] = $pconfig['passtos']; $client['udp_fast_io'] = $pconfig['udp_fast_io']; + $client['sndrcvbuf'] = $pconfig['sndrcvbuf']; $client['route_no_pull'] = $pconfig['route_no_pull']; $client['route_no_exec'] = $pconfig['route_no_exec']; @@ -893,6 +899,16 @@ if ($act=="new" || $act=="edit"): 'Not compatible with all platforms, and not compatible with OpenVPN bandwidth limiting.'); $section->addInput(new Form_Select( + 'sndrcvbuf', + 'Send/Receive Buffer', + $pconfig['sndrcvbuf'], + openvpn_get_buffer_values() + ))->setHelp('Configure a Send and Receive Buffer size for OpenVPN. ' . + 'The default buffer size can be too small in many cases, depending on hardware and network uplink speeds. ' . + 'Finding the best buffer size can take some experimentation. To test the best value for a site, start at ' . + '512KiB and test higher and lower values.'); + + $section->addInput(new Form_Select( 'verbosity_level', 'Verbosity level', $pconfig['verbosity_level'], -- cgit v1.1