diff options
author | Ermal <eri@pfsense.org> | 2013-03-08 08:44:50 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-03-08 08:45:17 +0000 |
commit | a362a23a829f5c5ebeb3fb319272592711e2ea02 (patch) | |
tree | 21cdc29ad137a35a47ade17605b9438d43aa0ac4 /etc | |
parent | ca3301b4c817ab450c7eaac6499b5b8a66ed3c2e (diff) | |
download | pfsense-a362a23a829f5c5ebeb3fb319272592711e2ea02.zip pfsense-a362a23a829f5c5ebeb3fb319272592711e2ea02.tar.gz |
Solve the issue when changing vlan parent mtu and leaving its childs with older mtu.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/interfaces.inc | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index a1864de..2fb801b 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -2963,6 +2963,23 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven pfSense_interface_mtu($realhwif, $wancfg['mtu']); } } + } else { + $vlanifs = link_interface_to_vlans($realif); + if (!empty($vlanifs)) { + foreach ($vlanifs as $vlanif) { + $assginedport = convert_real_interface_to_friendly_interface_name($vlan['vlanif']); + if (empty($assginedport)) + pfSense_interface_mtu($vlan['vlanif'], $wancfg['mtu']); + else { + $vlanmtu = $config['interfaces'][$assginedport]['mtu']; + if (!empty($vlanmtu) && $vlanmtu < $wancfg['mtu']) + continue; + else + pfSense_interface_mtu($vlan['vlanif'], $wancfg['mtu']); + } + } + unset($vlanifs); + } } if ($wancfg['mtu'] != get_interface_mtu($realif)) pfSense_interface_mtu($realif, $wancfg['mtu']); @@ -4150,14 +4167,17 @@ function link_interface_to_vlans($int, $action = "") { return; if (is_array($config['vlans']['vlan'])) { + $ifaces = array(); foreach ($config['vlans']['vlan'] as $vlan) { if ($int == $vlan['if']) { if ($action == "update") { interfaces_bring_up($int); } else if ($action == "") - return $vlan; + $ifaces[$vlan['tag']] = $vlan; } } + if (!empty($ifaces)) + return $ifaces; } } |