diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-09-12 14:53:26 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-09-12 14:53:26 -0300 |
commit | 4f7bba4647a291b31d8a8029df2a6c584a6bc138 (patch) | |
tree | 54caa6ff041daf3c8c3ea8b8f3359cbe7fc0c393 | |
parent | 30cbc0070c600dd4f052ee01a69cd3e55dda570a (diff) | |
download | pfsense-4f7bba4647a291b31d8a8029df2a6c584a6bc138.zip pfsense-4f7bba4647a291b31d8a8029df2a6c584a6bc138.tar.gz |
Do not allow local mac address to be added to passtrumac list in CP. It fixes #3122
-rwxr-xr-x | usr/local/www/services_captiveportal_mac_edit.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/usr/local/www/services_captiveportal_mac_edit.php b/usr/local/www/services_captiveportal_mac_edit.php index dfd471f..3ec29d6 100755 --- a/usr/local/www/services_captiveportal_mac_edit.php +++ b/usr/local/www/services_captiveportal_mac_edit.php @@ -100,8 +100,19 @@ if ($_POST) { $_POST['mac'] = str_replace("-", ":", $_POST['mac']); - if (($_POST['mac'] && !is_macaddr($_POST['mac']))) - $input_errors[] = sprintf("%s. [%s]", gettext("A valid MAC address must be specified"), $_POST['mac']); + if ($_POST['mac']) { + if (is_macaddr($_POST['mac'])) { + $iflist = get_interface_list(); + foreach ($iflist as $if) { + if ($_POST['mac'] == strtolower($if['mac'])) { + $input_errors[] = sprintf(gettext("The MAC address %s belongs to a local interface, you cannot use it here."), $_POST['mac']); + break; + } + } + } else { + $input_errors[] = sprintf("%s. [%s]", gettext("A valid MAC address must be specified"), $_POST['mac']); + } + } if ($_POST['bw_up'] && !is_numeric($_POST['bw_up'])) $input_errors[] = gettext("Upload speed needs to be an integer"); if ($_POST['bw_down'] && !is_numeric($_POST['bw_down'])) |