diff options
author | David Wood <david@wood2.org.uk> | 2015-10-10 22:59:59 +0100 |
---|---|---|
committer | David Wood <david@wood2.org.uk> | 2015-10-11 03:30:11 +0100 |
commit | 80f142db9a7c2e1353bf8132669394c7144399d0 (patch) | |
tree | a60c8693af54a68cb2c0b101676cbc0635963e8f /src/etc/inc | |
parent | 6a74d2d7e3e0cbd1e6c9de662dd0e0e02a209733 (diff) | |
download | pfsense-80f142db9a7c2e1353bf8132669394c7144399d0.zip pfsense-80f142db9a7c2e1353bf8132669394c7144399d0.tar.gz |
Limit interface MTU to 1500 if no explicit MTU configured
Without this change, setting the MTU of a PPPoE interface with a
VLAN parent interface above 1492 will result in the MTU of other
VLANs on the same physical NIC that are not explicitly configured
to rise above 1500. It seems unwise - and a Principle of Least
Astonishment breach - for an MTU requiring Ethernet jumbo frames
to come about without explicit configuration.
Diffstat (limited to 'src/etc/inc')
-rw-r--r-- | src/etc/inc/interfaces.inc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index f321d60..d30866f 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -3088,15 +3088,15 @@ function interface_vlan_adapt_mtu($vlanifs, $mtu) { } else if ($pppoe_mtu != 0) { pfSense_interface_mtu($vlan['vlanif'], $pppoe_mtu); } else { - if (get_interface_mtu($vlan['vlanif']) != $mtu) { - pfSense_interface_mtu($vlan['vlanif'], $mtu); + if (get_interface_mtu($vlan['vlanif']) != (($mtu > 1500) ? 1500 : $mtu)) { + pfSense_interface_mtu($vlan['vlanif'], (($mtu > 1500) ? 1500 : $mtu)); } } } else { if ($pppoe_mtu != 0) { pfSense_interface_mtu($vlan['vlanif'], $pppoe_mtu); - } else if (get_interface_mtu($vlan['vlanif']) != $mtu) { - pfSense_interface_mtu($vlan['vlanif'], $mtu); + } else if (get_interface_mtu($vlan['vlanif']) != (($mtu > 1500) ? 1500 : $mtu)) { + pfSense_interface_mtu($vlan['vlanif'], (($mtu > 1500) ? 1500 : $mtu)); } } } @@ -3290,6 +3290,11 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven } } + // Limit the MTU to 1500 if no explicit MTU configured + if ($wantedmtu == 0 && get_interface_mtu($mtuif) > 1500) { + $wantedmtu = 1500; + } + if ($wantedmtu != 0) { if (stristr($mtuif, "_vlan")) { $assignedparent = convert_real_interface_to_friendly_interface_name($mtuhwif); |