diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-11-20 23:00:31 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-11-20 23:00:31 +0000 |
commit | f7eb54e49b387bf59e085ed2015b67c7889e7989 (patch) | |
tree | 1495bb36a66fbb9ac6a84c3235ed694800d5479c /etc/inc/pfsense-utils.inc | |
parent | 7a7371d14e6b5ea941f4027c8a0c3fd33bb2863c (diff) | |
download | pfsense-f7eb54e49b387bf59e085ed2015b67c7889e7989.zip pfsense-f7eb54e49b387bf59e085ed2015b67c7889e7989.tar.gz |
* Add interface_supports_polling()
* Use interface_supports_polling()
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index ce27951..b0a8957 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -950,7 +950,7 @@ function enable_hardware_offloading($interface) { mwexec("/sbin/ifconfig {$interface} rxcsum 2>/dev/null"); /* if the NIC supports polling *AND* it is enabled in the GUI */ - if(stristr($options, "polling") == true) { + if(interface_supports_polling($interface)) { $polling = isset($config['system']['polling']); if($polling) { mwexec("sysctl kern.polling.enable=1"); @@ -962,6 +962,43 @@ function enable_hardware_offloading($interface) { return; } +/****f* pfsense-utils/interface_supports_polling + * NAME + * checks to see if an interface supports polling according to man polling + * INPUTS + * + * RESULT + * true or false + * NOTES + * + ******/ +function interface_supports_polling($iface) { + $pattern = '/([a-z].*)[0-9]/'; + preg_match($pattern, $iface, $iface2); + $interface=$iface2[1]; + $supported_ints = array("bge", + "dc", + "em", + "fwe", + "fwip", + "fxp", + "ixgb", + "nfe", + "vnge", + "re", + "rl", + "sf", + "vsis", + "ste", + "vstge", + "vvge", + "vr", + "xl"); + if(in_array($interface, $supported_ints)) + return true; + return false; +} + /****f* pfsense-utils/is_alias_inuse * NAME * checks to see if an alias is currently in use by a rule |