summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal LUÇI <eri@pfsense.org>2014-11-26 20:34:12 +0100
committerErmal LUÇI <eri@pfsense.org>2014-11-26 20:34:28 +0100
commit5e0a3256b291cc54d14dcb16c1b07018e1febd41 (patch)
treed16da1bc191af1b00ec0994f0d3a12d9f2d4e724
parent4f5577f6628bb6e761127d6202b6d25f14a53821 (diff)
downloadpfsense-5e0a3256b291cc54d14dcb16c1b07018e1febd41.zip
pfsense-5e0a3256b291cc54d14dcb16c1b07018e1febd41.tar.gz
convert_real_interface_to_friendly_interface_name() goes and checks the parent and this gives wrong information 99.9 percent of the time on scenarios like when this is called for unassigned vlans etc, while its real purpose is just to check if the interface is assigned and return the intermeddiate/config name of the interface. Leave the get_parent_option there in the function but it needs to be asked specifically for.
-rw-r--r--etc/inc/interfaces.inc7
-rw-r--r--usr/local/www/interfaces.php2
2 files changed, 6 insertions, 3 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 3cdeca8..28ab2c2 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -2678,7 +2678,7 @@ EOD;
/* bring the clones back up that were previously up */
foreach ($clones_up as $clone_if) {
- mwexec("{$ifconfig} " . escapeshellarg($clone_if) . " up");
+ interfaces_bring_up($clone_if);
/*
* Rerun the setup script for the interface if it isn't this interface, the interface
@@ -4009,7 +4009,7 @@ function get_current_wan_address($interface = "wan") {
/*
* convert_real_interface_to_friendly_interface_name($interface): convert fxp0 -> wan, etc.
*/
-function convert_real_interface_to_friendly_interface_name($interface = "wan") {
+function convert_real_interface_to_friendly_interface_name($interface = "wan", $checkparent = false) {
global $config;
if (stripos($interface, "_vip")) {
@@ -4032,6 +4032,9 @@ function convert_real_interface_to_friendly_interface_name($interface = "wan") {
if (get_real_interface($if) == $interface)
return $if;
+ if ($checkparent == false)
+ continue;
+
$int = get_parent_interface($if, true);
if (is_array($int)) {
foreach ($int as $iface) {
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php
index 7d2a066..c044ea7 100644
--- a/usr/local/www/interfaces.php
+++ b/usr/local/www/interfaces.php
@@ -734,7 +734,7 @@ if ($_POST['apply']) {
// Need code to handle MLPPP if we ever use $realhwif for MLPPP handling
$parent_realhwif = $realhwif_array[0];
$parent_if = convert_real_interface_to_friendly_interface_name($parent_realhwif);
- if (!empty($parent_if) && $parent_if != $if && !empty($config['interfaces'][$parent_if]['mtu'])) {
+ if (!empty($parent_if) && !empty($config['interfaces'][$parent_if]['mtu'])) {
if ($_POST['mtu'] > intval($config['interfaces'][$parent_if]['mtu']))
$input_errors[] = gettext("The MTU of a VLAN cannot be greater than that of its parent interface.");
}
OpenPOWER on IntegriCloud