summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/interfaces.php
diff options
context:
space:
mode:
authorLuiz Otavio O Souza <luiz@netgate.com>2016-02-21 11:27:02 -0600
committerLuiz Otavio O Souza <luiz@netgate.com>2016-02-21 16:38:24 -0600
commit4a3a45c430bfc797af1db683eebf05b1311ec800 (patch)
tree6c84bd5b165730ed535303f9515bcdeb5f8189da /src/usr/local/www/interfaces.php
parent4c746b8c832417578fe8e186674b813524836517 (diff)
downloadpfsense-4a3a45c430bfc797af1db683eebf05b1311ec800.zip
pfsense-4a3a45c430bfc797af1db683eebf05b1311ec800.tar.gz
Properly check the parent's MTU when changing a VLAN MTU.
Diffstat (limited to 'src/usr/local/www/interfaces.php')
-rw-r--r--src/usr/local/www/interfaces.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php
index c9a3c16..f80235d 100644
--- a/src/usr/local/www/interfaces.php
+++ b/src/usr/local/www/interfaces.php
@@ -826,11 +826,13 @@ 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) && !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.");
- }
- }
+ $mtu = 0;
+ if (!empty($parent_if) && !empty($config['interfaces'][$parent_if]['mtu']))
+ $mtu = intval($config['interfaces'][$parent_if]['mtu']);
+ if ($mtu == 0)
+ $mtu = get_interface_mtu($parent_realhwif);
+ if ($_POST['mtu'] > $mtu)
+ $input_errors[] = gettext("The MTU of a VLAN cannot be greater than that of its parent interface.");
} else {
foreach ($config['interfaces'] as $idx => $ifdata) {
if (($idx == $if) || !preg_match('/_vlan[0-9]/', $ifdata['if'])) {
@@ -846,7 +848,7 @@ if ($_POST['apply']) {
}
if (isset($ifdata['mtu']) && $ifdata['mtu'] > $_POST['mtu']) {
- $input_errors[] = sprintf(gettext("Interface %s (VLAN) has MTU set to a larger value"), $ifdata['descr']);
+ $input_errors[] = sprintf(gettext("Interface %s (VLAN) has MTU set to a larger value."), $ifdata['descr']);
}
}
}
OpenPOWER on IntegriCloud