diff options
author | Ermal <eri@pfsense.org> | 2011-12-28 08:38:06 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2011-12-28 08:38:06 +0000 |
commit | 121dc11eac00c2244547bf942f3e4416c8b6cf3b (patch) | |
tree | 558d16fcccbac75f91fdc9c7036422cfd31629c7 /etc/inc/interfaces.inc | |
parent | 13113484a3f304455b5187a98a098c21ea0d74da (diff) | |
download | pfsense-121dc11eac00c2244547bf942f3e4416c8b6cf3b.zip pfsense-121dc11eac00c2244547bf942f3e4416c8b6cf3b.tar.gz |
Implement is_jumbo_capable in a more performant way. This should help with large number of interfaces
Diffstat (limited to 'etc/inc/interfaces.inc')
-rw-r--r-- | etc/inc/interfaces.inc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 3f67e5d..1740954 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -3729,15 +3729,14 @@ function generate_random_mac_address() { * RESULT * boolean - true or false ******/ -function is_jumbo_capable($int) { - global $g; +function is_jumbo_capable($iface) { - $int_family = preg_split("/[0-9]+/", $int); - - if (in_array($int_family[0], $g['vlan_long_frame'])) + $iface = trim($iface); + $capable = pfSense_get_interface_addresses($iface); + if (isset($capable['caps'][$CAPABILITIES])) return true; - else - return false; + + return false; } function setup_pppoe_reset_file($pppif, $iface="") { |