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:25 -0500 |
commit | 22ec33b9d6e8ae3787d4bb809c47bf42e2916a9a (patch) | |
tree | 3a086fab723fb21b55d1cf741a986578026f240a /usr | |
parent | bda6c6bf4f304cee0b0cd99d51fc813b06ae76b4 (diff) | |
download | pfsense-22ec33b9d6e8ae3787d4bb809c47bf42e2916a9a.zip pfsense-22ec33b9d6e8ae3787d4bb809c47bf42e2916a9a.tar.gz |
Add more validation for wireless config settings. Ticket #4516
Diffstat (limited to 'usr')
-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]) { |