summaryrefslogtreecommitdiffstats
path: root/etc/inc/pfsense-utils.inc
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2009-04-23 20:03:49 -0400
committerChris Buechler <cmb@pfsense.org>2009-04-23 20:03:49 -0400
commita4d71dc1c8644edf5440e6d4c7b6d45aeb59e3c9 (patch)
tree568bbb88f501039befe1f45e5dec72c595e9b20e /etc/inc/pfsense-utils.inc
parent7c71c208d432a1bde892b9b1c0aa8b15928e5a5d (diff)
downloadpfsense-a4d71dc1c8644edf5440e6d4c7b6d45aeb59e3c9.zip
pfsense-a4d71dc1c8644edf5440e6d4c7b6d45aeb59e3c9.tar.gz
Fix "disable checksum offloading", and some other bugs with certain combinations of options while here.
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r--etc/inc/pfsense-utils.inc31
1 files changed, 17 insertions, 14 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index f310f41..0988949 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -895,37 +895,40 @@ function enable_hardware_offloading($interface) {
if(stristr($interface,"lnc"))
return;
- if(isset($config['system']['do_not_use_nic_microcode']))
- return;
-
/* translate wan, lan, opt -> real interface if needed */
$int = filter_translate_type_to_real_interface($interface);
if($int <> "") $interface = $int;
$int_family = preg_split("/[0-9]+/", $int);
- $options = strtolower(`/sbin/ifconfig {$interface} | grep options`);
+ $options = strtolower(`/sbin/ifconfig -m {$interface} | grep capabilities`);
$supported_ints = array('fxp');
- if (in_array($int_family, $supported_ints))
+ if (in_array($int_family, $supported_ints)) {
+ if(isset($config['system']['do_not_use_nic_microcode']))
+ continue;
mwexec("/sbin/ifconfig {$interface} link0");
-
- if($config['system']['disablechecksumoffloading'])
- return;
+ }
/* skip vlans for checksumming and polling */
if(stristr($interface, "vlan"))
return;
- if(stristr($options, "txcsum") == true)
- mwexec("/sbin/ifconfig {$interface} txcsum 2>/dev/null");
-
- if(stristr($options, "rxcsum") == true)
- mwexec("/sbin/ifconfig {$interface} rxcsum 2>/dev/null");
+ if($config['system']['disablechecksumoffloading']) {
+ if(stristr($options, "txcsum") == true)
+ mwexec("/sbin/ifconfig {$interface} -txcsum 2>/dev/null");
+ if(stristr($options, "rxcsum") == true)
+ mwexec("/sbin/ifconfig {$interface} -rxcsum 2>/dev/null");
+ } else {
+ if(stristr($options, "txcsum") == true)
+ mwexec("/sbin/ifconfig {$interface} txcsum 2>/dev/null");
+ if(stristr($options, "rxcsum") == true)
+ mwexec("/sbin/ifconfig {$interface} rxcsum 2>/dev/null");
+ }
/* if the NIC supports polling *AND* it is enabled in the GUI */
if(interface_supports_polling($interface)) {
$polling = isset($config['system']['polling']);
if($polling) {
mwexec("sysctl kern.polling.enable=1");
- mwexec("/sbin/ifconfig {$interface} polling 2>/dev/null");
+ mwexec("/sbin/ifconfig {$interface} polling 2>/dev/null");
} else {
mwexec("sysctl kern.polling.enable=0");
}
OpenPOWER on IntegriCloud