diff options
-rw-r--r-- | src/etc/inc/util.inc | 19 | ||||
-rw-r--r-- | src/usr/local/www/diag_edit.php | 20 | ||||
-rw-r--r-- | src/usr/local/www/services_router_advertisements.php | 5 |
3 files changed, 30 insertions, 14 deletions
diff --git a/src/etc/inc/util.inc b/src/etc/inc/util.inc index 92149ff..9a28436 100644 --- a/src/etc/inc/util.inc +++ b/src/etc/inc/util.inc @@ -1701,13 +1701,27 @@ function alias_get_type($name) { /* expand a host or network alias, if necessary */ function alias_expand($name) { - global $aliastable; + global $config, $aliastable; + $urltable_prefix = "/var/db/aliastables/"; + $urltable_filename = $urltable_prefix . $name . ".txt"; if (isset($aliastable[$name])) { // alias names cannot be strictly numeric. redmine #4289 if (is_numericint($name)) { return null; } + // make sure if it's a ports alias, it actually exists. redmine #5845 + foreach ($config['aliases']['alias'] as $alias) { + if ($alias['name'] == $name) { + if ($alias['type'] == "urltable_ports") { + if (is_URL($alias['url']) && file_exists($urltable_filename) && filesize($urltable_filename)) { + return "\${$name}"; + } else { + return null; + } + } + } + } return "\${$name}"; } else if (is_ipaddr($name) || is_subnet($name) || is_port($name) || is_portrange($name)) { return "{$name}"; @@ -2052,6 +2066,9 @@ function is_interface_vlan_mismatch() { if (is_array($config['vlans']['vlan'])) { foreach ($config['vlans']['vlan'] as $vlan) { + if (substr($vlan['if'], 0, 4) == "lagg") { + return false; + } if (does_interface_exist($vlan['if']) == false) { return true; } diff --git a/src/usr/local/www/diag_edit.php b/src/usr/local/www/diag_edit.php index 6b78a83..cbfd35d 100644 --- a/src/usr/local/www/diag_edit.php +++ b/src/usr/local/www/diag_edit.php @@ -1,6 +1,6 @@ <?php /* - edit.php + diag_edit.php */ /* ==================================================================== * Copyright (c) 2004-2015 Electric Sheep Fencing, LLC. All rights reserved. @@ -57,7 +57,7 @@ ##|*IDENT=page-diagnostics-edit ##|*NAME=Diagnostics: Edit File ##|*DESCR=Allow access to the 'Diagnostics: Edit File' page. -##|*MATCH=edit.php* +##|*MATCH=diag_edit.php* ##|*MATCH=browser.php* ##|*MATCH=filebrowser/browser.php* ##|-PRIV @@ -70,21 +70,21 @@ if ($_POST['action']) { case 'load': if (strlen($_POST['file']) < 1) { print('|5|'); - print_info_box(gettext("No file name specified."), 'danger', false); + print_info_box(gettext("No file name specified."), 'danger'); print('|'); } elseif (is_dir($_POST['file'])) { print('|4|'); - print_info_box(gettext("Loading a directory is not supported."), 'danger', false); + print_info_box(gettext("Loading a directory is not supported."), 'danger'); print('|'); } elseif (!is_file($_POST['file'])) { print('|3|'); - print_info_box(gettext("File does not exist or is not a regular file."), 'danger', false); + print_info_box(gettext("File does not exist or is not a regular file."), 'danger'); print('|'); } else { $data = file_get_contents(urldecode($_POST['file'])); if ($data === false) { print('|1|'); - print_info_box(gettext("Failed to read file."), 'danger', false); + print_info_box(gettext("Failed to read file."), 'danger'); print('|'); } else { $data = base64_encode($data); @@ -96,7 +96,7 @@ if ($_POST['action']) { case 'save': if (strlen($_POST['file']) < 1) { print('|'); - print_info_box(gettext("No file name specified."), 'danger', false); + print_info_box(gettext("No file name specified."), 'danger'); print('|'); } else { conf_mount_rw(); @@ -111,15 +111,15 @@ if ($_POST['action']) { } if ($ret === false) { print('|'); - print_info_box(gettext("Failed to write file."), 'danger', false); + print_info_box(gettext("Failed to write file."), 'danger'); print('|'); } elseif ($ret != strlen($_POST['data'])) { print('|'); - print_info_box(gettext("Error while writing file."), 'danger', false); + print_info_box(gettext("Error while writing file."), 'danger'); print('|'); } else { print('|'); - print_info_box(gettext("File saved successfully."), 'success', false); + print_info_box(gettext("File saved successfully."), 'success'); print('|'); } } diff --git a/src/usr/local/www/services_router_advertisements.php b/src/usr/local/www/services_router_advertisements.php index 9ef58e1..ad91cd7 100644 --- a/src/usr/local/www/services_router_advertisements.php +++ b/src/usr/local/www/services_router_advertisements.php @@ -262,9 +262,8 @@ $tabscounter = 0; $i = 0; foreach ($iflist as $ifent => $ifname) { $oc = $config['interfaces'][$ifent]; - // We need at least one interface configured with a NON-LOCAL IPv6 static address. fd80:8dba:82e1::/64 fits the bill - if ((is_array($config['dhcpdv6'][$ifent]) && !isset($config['dhcpdv6'][$ifent]['enable']) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($oc['ipaddrv6'])))) || - (!is_array($config['dhcpdv6'][$ifent]) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($oc['ipaddrv6']))))) { + // We need interfaces configured with a static IPv6 address or track6 for PD. + if (!is_ipaddrv6($oc['ipaddrv6']) && $oc['ipaddrv6'] != "track6") { continue; } |