Revision 56da23dc
Added by Ermal LUÇI about 14 years ago
etc/inc/interfaces.inc | ||
---|---|---|
2579 | 2579 |
} |
2580 | 2580 |
if (!empty($wancfg['mtu'])) |
2581 | 2581 |
pfSense_interface_mtu($realhwif, $wancfg['mtu']); |
2582 |
else { |
|
2583 |
$mtu = get_interface_default_mtu(remove_numbers($realhwif)); |
|
2584 |
if ($mtu != get_interface_mtu($realhwif)) |
|
2585 |
pfSense_interface_mtu($mtu); |
|
2586 |
} |
|
2582 | 2587 |
|
2583 | 2588 |
$options = pfSense_get_interface_addresses($realhwif); |
2584 | 2589 |
if (is_array($options) && isset($options['caps']['polling'])) { |
... | ... | |
3689 | 3694 |
unlink_if_exists($cron_file); |
3690 | 3695 |
} |
3691 | 3696 |
|
3697 |
function get_interface_default_mtu($type = "ethernet") { |
|
3698 |
switch ($type) { |
|
3699 |
case "gre": |
|
3700 |
return 1476; |
|
3701 |
break; |
|
3702 |
case "gif": |
|
3703 |
return 1280; |
|
3704 |
break; |
|
3705 |
case "tun": |
|
3706 |
case "vlan": |
|
3707 |
case "tap": |
|
3708 |
case "ethernet": |
|
3709 |
default: |
|
3710 |
return 1500; |
|
3711 |
break; |
|
3712 |
} |
|
3713 |
|
|
3714 |
/* Never reached */ |
|
3715 |
return 1500; |
|
3716 |
} |
|
3717 |
|
|
3692 | 3718 |
function get_vip_descr($ipaddress) { |
3693 | 3719 |
global $config; |
3694 | 3720 |
|
Also available in: Unified diff
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.