Fixes #1394. Create a function get_itnerface_default_mtu and use it for resetting the mtu of a interface to default when needed. This adds the overhead of fetching the interface mtu and comparing with the default one every interface configuration run.

This commit is contained in:
Ermal 2011-05-04 21:31:53 +00:00
parent 131f3a5048
commit 56da23dc5f

View File

@ -2579,6 +2579,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($mtu);
}
$options = pfSense_get_interface_addresses($realhwif);
if (is_array($options) && isset($options['caps']['polling'])) {
@ -3689,6 +3694,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;