summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-03-04 09:50:48 -0300
committerRenato Botelho <garga@FreeBSD.org>2013-03-04 09:50:48 -0300
commit4a7352101fbd6901b46a3b6a9a3c00d23b75f0e1 (patch)
tree674a471c661c34b46fb49629fac68946b2d5dbb0 /etc
parent74889b22327fedff1a1a1d994f8dc67860098763 (diff)
downloadpfsense-4a7352101fbd6901b46a3b6a9a3c00d23b75f0e1.zip
pfsense-4a7352101fbd6901b46a3b6a9a3c00d23b75f0e1.tar.gz
Make parent interface and all VLANs use the same MTU. Fixes #2786
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/interfaces.inc29
1 files changed, 23 insertions, 6 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 499344e..7b04fb2 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -2888,14 +2888,31 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven
break;
}
- if (!empty($wancfg['mtu'])) {
- pfSense_interface_mtu($realif, $wancfg['mtu']);
- } else {
- $mtu = get_interface_default_mtu(remove_ifindex($realhwif));
- if ($mtu != get_interface_mtu($realhwif))
- pfSense_interface_mtu($realhwif, $mtu);
+ $mtu = get_interface_default_mtu(remove_ifindex($realhwif));
+
+ if (preg_match('/_vlan[0-9]/', $wancfg['if'])) {
+ foreach ($config['interfaces'] as $ifdescr => $ifdata) {
+ if ($ifdata['if'] == $realhwif) {
+ if (!empty($ifdata['mtu']))
+ $mtu = $ifdata['mtu'];
+ break;
+ }
+ }
+ } else if (!empty($wancfg['mtu'])) {
+ $mtu = $wancfg['mtu'];
}
+ if ($mtu != get_interface_mtu($realhwif))
+ pfSense_interface_mtu($realhwif, $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)
+ 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