diff options
Diffstat (limited to 'etc/inc/interfaces.inc')
-rw-r--r-- | etc/inc/interfaces.inc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index b3fd6db..015f0eb 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -417,6 +417,8 @@ function interface_bridge_configure(&$bridge) { $realif = get_real_interface($member); $opts = pfSense_get_interface_addresses($realif); $mtu = $opts['mtu']; + if (substr($realif, 0, 3) == "gif" && $mtu < 1500) + continue; if (!isset($opts['encaps']['txcsum'])) $commontx = false; if (!isset($opts['encaps']['rxcsum'])) @@ -2627,6 +2629,11 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven } if (!empty($wancfg['mtu'])) pfSense_interface_mtu($realhwif, $wancfg['mtu']); + else { + $mtu = get_interface_default_mtu(remove_numbers($realhwif)); + if ($mtu != get_interface_mtu($realhwif)) + pfSense_interface_mtu($realhwif, $mtu); + } $options = pfSense_get_interface_addresses($realhwif); if (is_array($options) && isset($options['caps']['polling'])) { @@ -3962,6 +3969,27 @@ EOD; unlink_if_exists($cron_file); } +function get_interface_default_mtu($type = "ethernet") { + switch ($type) { + case "gre": + return 1476; + break; + case "gif": + return 1280; + break; + case "tun": + case "vlan": + case "tap": + case "ethernet": + default: + return 1500; + break; + } + + /* Never reached */ + return 1500; +} + function get_vip_descr($ipaddress) { global $config; |