diff options
author | Ermal LUÇI <eri@pfsense.org> | 2014-11-26 14:41:25 +0100 |
---|---|---|
committer | Ermal LUÇI <eri@pfsense.org> | 2014-11-26 14:41:25 +0100 |
commit | 2f8f9d5ac0c39c5f6a59cbc13e5370ca45892593 (patch) | |
tree | bbbfdf70ebeb5493e1bea4fe502f2cb04d92cc78 /etc/inc | |
parent | e702e9ed5dd7fc7029ffc21f4d368910c2a937f3 (diff) | |
download | pfsense-2f8f9d5ac0c39c5f6a59cbc13e5370ca45892593.zip pfsense-2f8f9d5ac0c39c5f6a59cbc13e5370ca45892593.tar.gz |
Add checks for requirement as array here. Reported-by: garga
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/interfaces.inc | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 22ddb25..e74e3af 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -4524,31 +4524,37 @@ function interface_find_child_cfgmtu($realiface) { } $mtu = 0; - foreach ($vlans as $vlan) { - $ifass = convert_real_interface_to_friendly_interface_name($vlan['vlanif']); - if (empty($ifass)) - continue; - if (!empty($config['interfaces'][$ifass]['mtu'])) { - if (intval($config['interfaces'][$ifass]['mtu']) > $mtu) - $mtu = intval($config['interfaces'][$ifass]['mtu']); + if (is_array($vlans)) { + foreach ($vlans as $vlan) { + $ifass = convert_real_interface_to_friendly_interface_name($vlan['vlanif']); + if (empty($ifass)) + continue; + if (!empty($config['interfaces'][$ifass]['mtu'])) { + if (intval($config['interfaces'][$ifass]['mtu']) > $mtu) + $mtu = intval($config['interfaces'][$ifass]['mtu']); + } } } - foreach ($gifs as $vlan) { - $ifass = convert_real_interface_to_friendly_interface_name($vlan['gifif']); - if (empty($ifass)) - continue; - if (!empty($config['interfaces'][$ifass]['mtu'])) { - if (intval($config['interfaces'][$ifass]['mtu']) > $mtu) - $mtu = intval($config['interfaces'][$ifass]['mtu']); + if (is_array($gifs)) { + foreach ($gifs as $vlan) { + $ifass = convert_real_interface_to_friendly_interface_name($vlan['gifif']); + if (empty($ifass)) + continue; + if (!empty($config['interfaces'][$ifass]['mtu'])) { + if (intval($config['interfaces'][$ifass]['mtu']) > $mtu) + $mtu = intval($config['interfaces'][$ifass]['mtu']); + } } } - foreach ($gres as $vlan) { - $ifass = convert_real_interface_to_friendly_interface_name($vlan['greif']); - if (empty($ifass)) - continue; - if (!empty($config['interfaces'][$ifass]['mtu'])) { - if (intval($config['interfaces'][$ifass]['mtu']) > $mtu) - $mtu = intval($config['interfaces'][$ifass]['mtu']); + if (is_array($gres)) { + foreach ($gres as $vlan) { + $ifass = convert_real_interface_to_friendly_interface_name($vlan['greif']); + if (empty($ifass)) + continue; + if (!empty($config['interfaces'][$ifass]['mtu'])) { + if (intval($config['interfaces'][$ifass]['mtu']) > $mtu) + $mtu = intval($config['interfaces'][$ifass]['mtu']); + } } } $ifass = convert_real_interface_to_friendly_interface_name($bridge); |