diff options
author | Ermal Luçi <eri@pfsense.org> | 2008-11-05 21:07:10 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2008-11-05 21:07:10 +0000 |
commit | 69e53ef07fc5928f96d66f74a94d3758774f045e (patch) | |
tree | b954f3c8fda4829e86ff5bd7f8099f1c915e2bfd /etc | |
parent | b64523c146437c3b3cf9b0f73ef1d3d9bd193698 (diff) | |
download | pfsense-69e53ef07fc5928f96d66f74a94d3758774f045e.zip pfsense-69e53ef07fc5928f96d66f74a94d3758774f045e.tar.gz |
Be smarter at finding the smallest mtu.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/interfaces.inc | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index c05fda5..4fa6ceb 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -146,14 +146,20 @@ function interface_bridge_configure(&$bridge) $bridgeif = exec("/sbin/ifconfig bridge create"); /* Calculate smaller mtu and enforce it */ - $smallermtu = 1500; + $smallermtu = 0; foreach ($members as $member) { $realif = get_real_interface($member); $mtu = get_interface_mtu($realif); - if (!empty($mtu) && $mtu < $smallermtu) + if ($smallermtu == 0 && !empty($mtu)) + $smallermtu = $mtu; + else if (!empty($mtu) && $mtu < $smallermtu) $smallermtu = $mtu; } + /* Just in case anything is not working well */ + if ($smallermtu == 0) + $smallermtu = 1500; + /* Add interfaces to bridge */ foreach ($members as $member) { if (!array_key_exists($member, $checklist)) @@ -310,15 +316,20 @@ function interface_lagg_configure(&$lagg) mwexec("/sbin/ifconfig {$laggif} {$lagg['proto']}"); /* Calculate smaller mtu and enforce it */ - $smallermtu = 1500; + $smallermtu = 0; foreach ($members as $member) { $realif = get_real_interface($member); $mtu = get_interface_mtu($realif); - if (!empty($mtu) && $mtu < $smallermtu) + if ($smallermtu == 0 && !empty($mtu)) + $smallermtu = $mtu; + else if (!empty($mtu) && $mtu < $smallermtu) $smallermtu = $mtu; } - $cmd = ""; + /* Just in case anything is not working well */ + if ($smallermtu == 0) + $smallermtu = 1500; + foreach ($members as $member) { if (!array_key_exists($member, $checklist)) continue; |