From 0e9ed7d833041911371aea967772a26da6532ddd Mon Sep 17 00:00:00 2001 From: glaszig Date: Thu, 1 Aug 2019 22:32:44 +0200 Subject: [PATCH 1/2] make hostapd's max_num_sta configurable --- includes/hostapd.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/includes/hostapd.php b/includes/hostapd.php index 317642ab..26556d75 100755 --- a/includes/hostapd.php +++ b/includes/hostapd.php @@ -225,6 +225,13 @@ if ($arrConfig['ignore_broadcast_ssid'] == 1 || $arrConfig['ignore_broadcast_ssi +
+
+ + " aria-describedby="max_num_sta_help"> + Configures the max_num_sta option of hostapd. The default and maximum is 2007. If empty or 0, the default applies. +
+
@@ -608,6 +615,10 @@ function SaveHostAPDConfig($wpa_array, $enc_types, $modes, $interfaces, $status) $good_input = false; } + $_POST['max_num_sta'] = (int) $_POST['max_num_sta']; + $_POST['max_num_sta'] = $_POST['max_num_sta'] > 2007 ? 2007 : $_POST['max_num_sta']; + $_POST['max_num_sta'] = $_POST['max_num_sta'] < 1 ? null : $_POST['max_num_sta']; + if ($good_input) { // Fixed values $config = 'driver=nl80211'.PHP_EOL; @@ -637,6 +648,9 @@ function SaveHostAPDConfig($wpa_array, $enc_types, $modes, $interfaces, $status) $config.= 'wpa_pairwise='.$_POST['wpa_pairwise'].PHP_EOL; $config.= 'country_code='.$_POST['country_code'].PHP_EOL; $config.= 'ignore_broadcast_ssid='.$ignore_broadcast_ssid.PHP_EOL; + if (isset($_POST['max_num_sta'])) { + $config.= 'max_num_sta='.$_POST['max_num_sta'].PHP_EOL; + } file_put_contents("/tmp/hostapddata", $config); system("sudo cp /tmp/hostapddata " . RASPI_HOSTAPD_CONFIG, $return); From 3f9d176793893a78bff606fe4d2037a70e6b066c Mon Sep 17 00:00:00 2001 From: glaszig Date: Sat, 10 Aug 2019 11:57:10 +0200 Subject: [PATCH 2/2] show current nax_num_sta as input value, make field description translatable --- includes/hostapd.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/hostapd.php b/includes/hostapd.php index 26556d75..f5082ac6 100755 --- a/includes/hostapd.php +++ b/includes/hostapd.php @@ -228,8 +228,8 @@ if ($arrConfig['ignore_broadcast_ssid'] == 1 || $arrConfig['ignore_broadcast_ssi
- " aria-describedby="max_num_sta_help"> - Configures the max_num_sta option of hostapd. The default and maximum is 2007. If empty or 0, the default applies. + " aria-describedby="max_num_sta_help"> + max_num_sta option of hostapd. The default and maximum is 2007. If empty or 0, the default applies.") ?>