diff options
author | Scott Ullrich <sullrich@G5.local> | 2009-10-25 19:02:06 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@G5.local> | 2009-10-25 19:02:06 -0400 |
commit | a2934331416523f289e7662da028d3e5bef8faf8 (patch) | |
tree | 70c8de7065d596e45396ee2b87d96130118e59e7 | |
parent | cddb1be2e9da0ef324ce8a1acc008ff8d6763291 (diff) | |
download | pfsense-a2934331416523f289e7662da028d3e5bef8faf8.zip pfsense-a2934331416523f289e7662da028d3e5bef8faf8.tar.gz |
Use get_real_interface() and does_interface_exist()
-rw-r--r-- | etc/inc/pfsense-utils.inc | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index d29b9f4..dc03381 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -184,39 +184,41 @@ function enable_hardware_offloading($interface) { return; /* translate wan, lan, opt -> real interface if needed */ - $int = interface_translate_type_to_real($interface); - if($int <> "") $interface = $int; - $int_family = preg_split("/[0-9]+/", $int); + $int = get_real_interface($interface); + if($int <> "") + $interface = $int; + $int_family = preg_split("/[0-9]+/", $interface); $options = strtolower(`/sbin/ifconfig -m {$interface} | grep capabilities`); $supported_ints = array('fxp'); if (in_array($int_family, $supported_ints)) { - if(isset($config['system']['do_not_use_nic_microcode'])) - continue; - mwexec("/sbin/ifconfig {$interface} link0"); - } + if(isset($config['system']['do_not_use_nic_microcode'])) + continue; + if(does_interface_exist($interface)) + mwexec("/sbin/ifconfig {$interface} link0"); + } /* skip vlans for checksumming and polling */ if(stristr($interface, "vlan")) return; 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"); + 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(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"); } |