From a09f3d8e783f0eee6426c23c3444dd4ec9c7777c Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Sat, 20 Feb 2016 03:03:16 +0545 Subject: Changes for diag_edit rename --- src/usr/local/www/diag_edit.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/usr/local/www/diag_edit.php b/src/usr/local/www/diag_edit.php index 6b78a83..366723d 100644 --- a/src/usr/local/www/diag_edit.php +++ b/src/usr/local/www/diag_edit.php @@ -1,6 +1,6 @@ Date: Sat, 20 Feb 2016 03:36:34 +0545 Subject: Allow user to dismiss diag_edit messages Previously the close 'x' was displayed, but after this code was changed to use print_info_box() the close 'x' was not being displayed. --- src/usr/local/www/diag_edit.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/usr/local/www/diag_edit.php b/src/usr/local/www/diag_edit.php index 366723d..cbfd35d 100644 --- a/src/usr/local/www/diag_edit.php +++ b/src/usr/local/www/diag_edit.php @@ -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('|'); } } -- cgit v1.1 From 2ec7ab35dfd1592d3ad7f543878db7b3aad58457 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Fri, 19 Feb 2016 22:59:14 -0600 Subject: Validate URL table ports aliases exist before using them in a rule. Ticket #5845 --- src/etc/inc/util.inc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/etc/inc/util.inc b/src/etc/inc/util.inc index 92149ff..a696494 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}"; -- cgit v1.1 From 2915acf8d2ba0b6a073f6ba7d1175273283d4e3b Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Fri, 19 Feb 2016 23:25:19 -0600 Subject: Don't trigger an interface mismatch for lagg interfaces, they may not exist at time of config restore. Ticket #5892 --- src/etc/inc/util.inc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/etc/inc/util.inc b/src/etc/inc/util.inc index a696494..9a28436 100644 --- a/src/etc/inc/util.inc +++ b/src/etc/inc/util.inc @@ -2066,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; } -- cgit v1.1 From 7a9f877471f2e4e48ab98d69b824236dee36c7b8 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Fri, 19 Feb 2016 23:55:27 -0600 Subject: Simplify check for which interfaces can have RAs, and show track6 interfaces without having to enable DHCPv6 server. Ticket #3029 --- src/usr/local/www/services_router_advertisements.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') 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; } -- cgit v1.1