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);