Skip to content

Commit

Permalink
Solve the issue when changing vlan parent mtu and leaving its childs …
Browse files Browse the repository at this point in the history
…with older mtu.
  • Loading branch information
Ermal committed Mar 8, 2013
1 parent ca3301b commit a362a23
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion etc/inc/interfaces.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down Expand Up @@ -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;
}
}

Expand Down

0 comments on commit a362a23

Please sign in to comment.