--- interfaces.inc.old2 2016-04-21 18:57:29.322112000 +0100 +++ interfaces.inc 2016-04-21 19:44:08.653020000 +0100 @@ -772,6 +772,7 @@ /* Check if MTU was defined for this lagg interface */ $lagg_mtu = interface_find_child_cfgmtu($laggif); + if ($lagg_mtu == 0 && is_array($config['interfaces'])) { foreach ($config['interfaces'] as $tmpinterface) { @@ -782,7 +783,7 @@ } } } - + /* Just in case anything is not working well */ if ($lagg_mtu == 0) { $lagg_mtu = 1500; @@ -4971,6 +4972,7 @@ $interface = convert_real_interface_to_friendly_interface_name($realiface); $vlans = link_interface_to_vlans($realiface); + $qinqs = link_interface_to_qinqs($realiface); $bridge = link_interface_to_bridge($realiface); if (!empty($interface)) { $gifs = link_interface_to_gif($interface); @@ -4994,6 +4996,19 @@ } } } + if (is_array($qinqs)) { + foreach ($qinqs as $qinq) { + $ifass = convert_real_interface_to_friendly_interface_name($qinq['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($gifs)) { foreach ($gifs as $gif) { $ifass = convert_real_interface_to_friendly_interface_name($gif['gifif']); @@ -5055,6 +5070,30 @@ } } +function link_interface_to_qinqs($int, $action = "") { + global $config; + + if (empty($int)) { + return; + } + + if (is_array($config['qinqs']['qinqentry'])) { + $ifaces = array(); + foreach ($config['qinqs']['qinqentry'] as $qinq) { + if ($int == $qinq['if']) { + if ($action == "update") { + interfaces_bring_up($int); + } else { + $ifaces[$qinq['tag']] = $qinq; + } + } + } + if (!empty($ifaces)) { + return $ifaces; + } + } +} + function link_interface_to_vips($int, $action = "", $vhid = '') { global $config;