summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-03-07 12:00:28 +0000
committerErmal <eri@pfsense.org>2013-03-07 12:00:28 +0000
commit2fff3ba2337c78e8059527dfc2b30dfb83402436 (patch)
tree6fe223bf0612f5760abf460f6ea095339641ed6b /etc
parent1e08ce645ba25e2678ce08a55d969f4704acf8d4 (diff)
downloadpfsense-2fff3ba2337c78e8059527dfc2b30dfb83402436.zip
pfsense-2fff3ba2337c78e8059527dfc2b30dfb83402436.tar.gz
Make this work better and not always go over things for setting mtu
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/interfaces.inc25
1 files changed, 15 insertions, 10 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 1174861..7e6d67d 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -2902,8 +2902,22 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven
$parentmtu = $config['interfaces'][$assginedparent]['mtu'];
if (empty($parentmtu))
$parentmtu = get_interface_mtu($realhwif);
- if ($wancfg['mtu'] > $parentmtu)
+ if ($wancfg['mtu'] > $parentmtu) {
pfSense_interface_mtu($realhwif, $wancfg['mtu']);
+
+ /* All vlans need to use the same mtu value as their parent. */
+ if (is_array($config['vlans']['vlan'])) {
+ foreach ($config['vlans']['vlan'] as $vlan) {
+ $assginedport = convert_real_interface_to_friendly_interface_name($vlan['vlanif']);
+ if (!empty($assginedport)) {
+ $portmtu = $config['interfaces'][$assginedport]['mtu'];
+ if (empty($portmtu))
+ pfSense_interface_mtu($vlan['vlanif'], $wancfg['mtu']);
+ } else if (($vlan['if'] == $realhwif) && (get_interface_mtu($vlan['vlanif']) != $wancfg['mtu']))
+ pfSense_interface_mtu($vlan['vlanif'], $wancfg['mtu']);
+ }
+ }
+ }
} else if ($wancfg['mtu'] != get_interface_mtu($realhwif))
pfSense_interface_mtu($realhwif, $wancfg['mtu']);
}
@@ -2913,15 +2927,6 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven
/* XXX: This is really dangerous for example with vlans changing their parent mtu! */
pfSense_interface_mtu($realhwif, $mtu);
- /*
- * All vlans need to use the same mtu value as their parent.
- * XXX: This is wrong. It should check for assigned vlans and see if there is any mtu set
- */
- if (is_array($config['vlans']['vlan']))
- foreach ($config['vlans']['vlan'] as $vlan)
- if (($vlan['if'] == $realhwif) && (get_interface_mtu($vlan['vlanif']) != $mtu))
- pfSense_interface_mtu($vlan['vlanif'], $mtu);
-
if(does_interface_exist($wancfg['if']))
interfaces_bring_up($wancfg['if']);
OpenPOWER on IntegriCloud