diff options
author | Chris Buechler <cmb@pfsense.org> | 2015-03-12 18:22:25 -0500 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2015-03-12 18:22:43 -0500 |
commit | 6cd14b43eeb1442fea6a9515977b137af39a3ae5 (patch) | |
tree | bc2d8dd2684db1757240775f117af53c31f89405 /usr/local/www/interfaces.php | |
parent | 95df2de5aaecdfaac04cedbe61923f36e58c28c0 (diff) | |
download | pfsense-6cd14b43eeb1442fea6a9515977b137af39a3ae5.zip pfsense-6cd14b43eeb1442fea6a9515977b137af39a3ae5.tar.gz |
Add more validation for wireless config settings. Ticket #4516
Diffstat (limited to 'usr/local/www/interfaces.php')
-rw-r--r-- | usr/local/www/interfaces.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index b52a44a..7020726 100644 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -810,6 +810,28 @@ if ($_POST['apply']) { $input_errors[] = gettext("Secondary 802.1X Authentication Server Port must be a valid port number (1-65535)."); } } + if (isset($_POST['channel']) && !is_numericint($_POST['channel'])) { + if (!is_numericint($_POST['channel'])) { + $input_errors[] = gettext("Invalid channel specified."); + } else { + if ($_POST['channel'] > 255 || $_POST['channel'] < 0) { + $input_errors[] = gettext("Channel must be between 0-255."); + } + } + } + if (!empty($_POST['distance']) && !is_numericint($_POST['distance'])) { + $input_errors[] = gettext("Distance must be an integer."); + } + if (isset($_POST['standard']) && (stristr($_POST['standard'], '11na') || stristr($_POST['standard'], '11a'))) { + if ($_POST['channel'] != 0 && $_POST['channel'] < 15) { + $input_errors[] = gettext("Channel selected is not valid for 802.11a or 802.11na."); + } + } + if (isset($_POST['standard']) && ($_POST['standard'] = "11b" || $_POST['standard'] = "11g")) { + if ($_POST['channel'] > 14) { + $input_errors[] = gettext("Channel selected is not valid for 802.11b or 802.11g."); + } + } /* loop through keys and enforce size */ for ($i = 1; $i <= 4; $i++) { if ($_POST['key' . $i]) { |