From f6d89471d3c526be7ff07b2b6307d4d2ebc6a2d7 Mon Sep 17 00:00:00 2001 From: Ermal Date: Fri, 27 Dec 2013 20:49:29 +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. Manual merge of 53555bf2f796cd53cf649410fe1827a9a45fc4a7 --- usr/local/www/interfaces.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 75fd460..d19d2ac 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -696,17 +696,15 @@ 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'])) { - $parent_mtu = $config['interfaces'][$parent_if]['mtu']; - - if ($_POST['mtu'] > $parent_mtu) + if (!empty($parent_if) && !empty($config['interfaces'][$parent_if]['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