From 53555bf2f796cd53cf649410fe1827a9a45fc4a7 Mon Sep 17 00:00:00 2001 From: Ermal Date: Fri, 27 Dec 2013 20:05:08 +0000 Subject: Make sense of interface mtu handling code. No need to do unneeded operations. This fixes slow boot times and proper handling of mtu for vlans though some work or better model is needed for other interface types. --- usr/local/www/interfaces.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr') diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 4b74997..922caa8 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -642,17 +642,17 @@ if ($_POST['apply']) { $input_errors[] = gettext("A valid MAC address must be specified."); if ($_POST['mtu']) { if ($_POST['mtu'] < 576 || $_POST['mtu'] > 9000) - $input_errors[] = gettext("The MTU must be greater than 576 bytes."); + $input_errors[] = gettext("The MTU must be greater than 576 bytes and less than 9000."); if (stristr($wancfg['if'], "_vlan")) { $realhwif_array = get_parent_interface($wancfg['if']); // 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) && isset($config['interfaces'][$parent_if]['mtu'])) { + if (!empty($parent_if) && !empty($config['interfaces'][$parent_if]['mtu'])) { $parent_mtu = $config['interfaces'][$parent_if]['mtu']; - if ($_POST['mtu'] > $parent_mtu) + if ($_POST['mtu'] > intval($config['interfaces'][$parent_if]['mtu'])) $input_errors[] = gettext("MTU of a vlan should not be bigger than parent interface."); } } else { -- cgit v1.1