summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-02-18 02:48:02 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-02-18 02:48:02 +0000
commitf4d81055849673c3c0b6e9fab760a4b0c10bde2f (patch)
treed060ab4ff06f359e89c23da8bb09f319e669f351 /etc
parentf818439bee190a5f5e1b84967be01d013344d171 (diff)
downloadpfsense-f4d81055849673c3c0b6e9fab760a4b0c10bde2f.zip
pfsense-f4d81055849673c3c0b6e9fab760a4b0c10bde2f.tar.gz
Correct enable polling per interface
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pfsense-utils.inc32
1 files changed, 20 insertions, 12 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 3cd7714..9ef427b 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -224,24 +224,32 @@ function setup_polling_defaults() {
*
******/
function setup_polling() {
- global $g, $config;
+ global $g, $config;
setup_polling_defaults();
+
+ if(isset($config['system']['polling']))
+ $supported_ints = array('dc', 'em', 'fwe', 'fwip', 'fxp', 'ixgb', 'ste', 'nge', 're', 'rl', 'sf', 'sis', 'ste', 'vge', 'vr', 'xl');
+ else
+ $supported_ints = array();
+
/* build an array of interfaces to work with */
$iflist = array("lan" => "LAN", "wan" => "WAN");
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++)
- $iflist['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
- /* activate polling for interface if it supports it
- * man polling on a freebsd box for the following list
- */
- /* loop through all interfaces and handle pftpx redirections */
- foreach ($iflist as $ifent => $ifname) {
- $supported_ints = array('dc', 'em', 'fwe', 'fwip', 'fxp', 'ixgb', 'ste',
- 'nge', 're', 'rl', 'sf', 'sis', 'ste', 'vge', 'vr', 'xl');
- if (in_array($ifname, $supported_ints) and isset($config['system']['polling'])) {
- mwexec("/sbin/ifconfig {$interface} polling");
+ $iflist['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
+
+ foreach ($iflist as $ifent => $ifname) {
+ $real_interface = convert_friendly_interface_to_real_interface_name($ifname);
+ $supported = false;
+ foreach($supported_ints as $supported) {
+ if(stristr($real_interface, $supported)) {
+ $supported = true;
+ }
+ }
+ if ($supported == true) {
+ mwexec("/sbin/ifconfig {$real_interface} polling");
} else {
- mwexec("/sbin/ifconfig {$interface} -polling");
+ mwexec("/sbin/ifconfig {$real_interface} -polling");
}
}
}
OpenPOWER on IntegriCloud