From 767a716ecd96105621e239633c04651a02bd8fb8 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 15 Jan 2006 03:33:18 +0000 Subject: Correct warnings and errors found eclipse --- etc/inc/filter.inc | 1 + etc/inc/interfaces.inc | 3 ++- etc/inc/lb.inc | 2 ++ etc/inc/openvpn.inc | 8 ++++---- etc/inc/pfsense-utils.inc | 12 ++++++++++-- etc/inc/pkg-utils.inc | 6 ++++++ etc/inc/shaper.inc | 2 ++ etc/inc/system.inc | 1 + etc/inc/util.inc | 7 ++++++- etc/inc/vpn.inc | 3 ++- etc/inc/xmlrpc_client.inc | 4 +++- usr/local/captiveportal/radius_accounting.inc | 5 ++++- usr/local/captiveportal/radius_authentication.inc | 1 + usr/local/www/diag_logs_filter.php | 2 +- usr/local/www/diag_ping.php | 2 ++ usr/local/www/guiconfig.inc | 9 ++++++--- usr/local/www/includes/functions.inc.php | 23 ++++++++++++++--------- usr/local/www/interfaces_wlan.inc | 2 +- usr/local/www/pkg_edit.php | 5 ++++- usr/local/www/services_dhcp_relay.php | 3 +++ usr/local/www/status.php | 2 ++ usr/local/www/status_interfaces.php | 6 ++++-- 22 files changed, 81 insertions(+), 28 deletions(-) diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 7d09e41..3be4049 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -1455,6 +1455,7 @@ EOD; /* pass traffic between statically routed subnets and the subnet on the interface in question to avoid problems with complicated routing topologies */ + $sa = ""; if (is_array($config['staticroutes']['route']) && count($config['staticroutes']['route'])) { foreach ($config['staticroutes']['route'] as $route) { unset($sa); diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 4c97418..dc2810f 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1390,7 +1390,7 @@ function get_current_wan_address($interface = "wan") { $wancfg = $config['interfaces'][$interface]; $interface = filter_translate_type_to_real_interface($interface); - + $ifinfo = ""; if(in_array($wancfg['ipaddr'], array('dhcp'))) { /* get interface info with netstat */ exec("/usr/bin/netstat -nWI " . escapeshellarg($interface) . " -f inet", $ifinfo); @@ -1456,6 +1456,7 @@ function get_number_of_bridged_interfaces() { $bridges_total = 0; $bridges = split("\n", `/sbin/ifconfig -a | /usr/bin/grep bridge | grep flags`); foreach($bridges as $bridge) { + $match_array = ""; preg_match_all("/bridge(.*):/",$bridge,$match_array); if($match_array[1][0] <> "") { if($match_array[1][0] > $bridges_total) diff --git a/etc/inc/lb.inc b/etc/inc/lb.inc index 8bb4ca2..62a41fd 100644 --- a/etc/inc/lb.inc +++ b/etc/inc/lb.inc @@ -123,7 +123,9 @@ require_once("functions.inc"); } function get_state($ip){ + $result = ""; $pingcmd = exec("/usr/local/bin/sudo /sbin/ping -c1 -t1 -n ".$ip,$result); + $match = ""; if (preg_match_all('/.*100\%\spacket\sloss.*/',$result[count($result)-1], $match)) return 0; if (preg_match_all('/.*0\%\spacket\sloss.*/',$result[count($result)-2], $match)) diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc index ee151f4..52a5851 100644 --- a/etc/inc/openvpn.inc +++ b/etc/inc/openvpn.inc @@ -439,7 +439,7 @@ EOD; /* Define an OVPN Server tunnel interface in the interfaces array and assign a name */ function ovpn_server_iface(){ - global $config, $g; + global $config, $g, $bridge_configure, $filter_configure; unset($filter_configure); unset($bridge_configure); @@ -1018,7 +1018,7 @@ EOD; /* Define an OVPN tunnel interface in the interfaces array for each client */ function ovpn_client_iface(){ - global $config; + global $config, $filter_configure, $bridge_configure; unset($filter_configure); unset($bridge_configure); @@ -1386,7 +1386,7 @@ function ovpn_ccd_sort() { /* called by interfaces_opt.php */ function ovpn_config_post() { - global $_POST, $optcfg, $pconfig; + global $_POST, $optcfg, $pconfig, $input_errors; unset($input_errors); @@ -1414,7 +1414,7 @@ function ovpn_config_post() { } function check_bridging($bridge) { - global $config; + global $config, $input_errors, $index; unset($input_errors); /* double bridging? */ diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 2c6f0e3..11bfec5 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -46,6 +46,8 @@ function get_tmp_file() { * null ******/ function get_dns_servers() { + $lastseen = ""; + $matches = ""; $dns_servers = array(); $dns = `cat /etc/resolv.conf`; $dns_s = split("\n", $dns); @@ -230,7 +232,7 @@ function setup_polling() { 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($int_family, $supported_ints) and isset($config['system']['polling'])) { + if (in_array($ifname, $supported_ints) and isset($config['system']['polling'])) { mwexec("/sbin/ifconfig {$interface} polling"); } else { mwexec("/sbin/ifconfig {$interface} -polling"); @@ -760,6 +762,7 @@ function exec_command_and_return_text($command) { */ function execute_command_return_output($command) { global $fd_log; + $lasttext = ""; $fd = popen($command . " 2>&1 ", "r"); echo "\n"; $counter = 0; @@ -848,6 +851,7 @@ function gather_altq_queue_stats($dont_return_root_queues) { $stats = `/sbin/pfctl -vvsq & /bin/sleep 5;/usr/bin/killall pfctl 2>/dev/null`; $stats_array = split("\n", $stats); $queue_stats = array(); + $match_array = ""; foreach ($stats_array as $stats_line) { if (preg_match_all("/queue\s+(\w+)\s+/",$stats_line,$match_array)) $queue_name = $match_array[1][0]; @@ -932,7 +936,7 @@ function backup_vip_config_section() { * to disk/cf. */ function restore_config_section($section, $new_contents) { - global $config; + global $config, $g; conf_mount_rw(); $fout = fopen("{$g['tmp_path']}/tmpxml","w"); fwrite($fout, $new_contents); @@ -951,6 +955,7 @@ function restore_config_section($section, $new_contents) { * written by nf@bigpond.net.au */ function http_post($server, $port, $url, $vars) { + global $errstr; $user_agent = "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)"; $urlencoded = ""; while (list($key,$value) = each($vars)) @@ -971,6 +976,7 @@ Content-Length: $content_length "; + $errno = ""; $fp = fsockopen($server, $port, $errno, $errstr); if (!$fp) { return false; @@ -1071,6 +1077,7 @@ function rmdir_recursive($path,$follow_links=false) { */ function get_memory() { if(file_exists("/var/log/dmesg.boot")) { + $matches = ""; $mem = `cat /var/log/dmesg.boot | grep memory`; if (preg_match_all("/real memory = .* \((.*) MB/", $mem, $matches)) $real = $matches[1]; @@ -1151,6 +1158,7 @@ function check_firmware_version($tocheck = "all", $return_php = true) { } function get_disk_info() { + $diskout = ""; exec("df -h | grep -w '/' | awk '{ print $2, $3, $4, $5 }'", $diskout); return explode(' ', $diskout[0]); // $size, $used, $avail, $cap diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 15b305e..dd56e4d 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -277,6 +277,7 @@ function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url = download_file_with_progress_bar($base_url . '/' . $filename, $fetchto); $static_output .= " (extracting)"; update_output_window($static_output); + $slaveout = ""; exec("/usr/bin/tar --fast-read -O -f {$fetchto} -x +CONTENTS 2>&1", $slaveout); $workingdir = preg_grep("/instmp/", $slaveout); $workingdir = $workingdir[0]; @@ -297,6 +298,7 @@ function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url = } } } + $pkgaddout = ""; exec("cat {$g['tmp_path']}/y | /usr/sbin/pkg_add -fv {$fetchto} 2>&1", $pkgaddout); @fwrite($fd_log, $pkgname . " " . print_r($pkgaddout, true) . "\n"); return true; @@ -329,6 +331,7 @@ function download_file_with_progress_bar($url_file, $destination_file) { function read_header($ch, $string) { global $file_size, $fout; + $regs = ""; $length = strlen($string); ereg("(Content-Length:) (.*)", $string, $regs); if($regs[2] <> "") { @@ -543,6 +546,7 @@ function install_package_xml($pkg) { download_file_with_progress_bar($afn['item'][0], $prefix . $filename); if(stristr($filename, ".tgz") <> "") { fwrite($fd_log, "Extracting tarball to -C for " . $filename . "...\n"); + $tarout = ""; exec("/usr/bin/tar xvzf " . $prefix . $filename . " -C / 2>&1", $tarout); fwrite($fd_log, print_r($tarout, true) . "\n"); } @@ -625,6 +629,8 @@ function delete_package($pkg) { } function delete_package_recursive($pkg) { + $info = ""; + $pkgdb = ""; exec("/usr/sbin/pkg_info -r " . $pkg . " 2>&1", $info); exec("cat {$g['tmp_path']}/y | /usr/sbin/pkg_delete " . $pkg ." > /dev/null 2>&1"); exec("/bin/ls /var/db/pkg", $pkgdb); diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc index 461f916..00316b1 100644 --- a/etc/inc/shaper.inc +++ b/etc/inc/shaper.inc @@ -307,6 +307,8 @@ function filter_generate_pf_altq_rules() { /* I don't think we're in IPFW anymore Toto */ global $config, $g, $tcpflags; + + $i = 0; $lancfg = $config['interfaces']['lan']; $pptpdcfg = $config['pptpd']; diff --git a/etc/inc/system.inc b/etc/inc/system.inc index fdf11ca..dc3a850 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -940,6 +940,7 @@ function system_dmesg_save() { echo "system_dmesg_save() being called $mt\n"; } + $dmesg = ""; exec("/sbin/dmesg", $dmesg); /* find last copyright line (output from previous boots may be present) */ diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 14ead40..4235adf 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -273,6 +273,7 @@ function get_interface_list($mode = "active", $keyby = "physical", $vfaces = "") break; case "media": $intlist = explode(" ", trim(shell_exec("/sbin/ifconfig -l"))); + $ifconfig = ""; exec("/sbin/ifconfig -a", $ifconfig); $regexp = '/(' . implode('|', $intlist) . '):\s/'; $ifstatus = preg_grep('/status:/', $ifconfig); @@ -283,9 +284,11 @@ function get_interface_list($mode = "active", $keyby = "physical", $vfaces = "") break; } /* build interface list with netstat */ + $linkinfo = ""; exec("/usr/bin/netstat -inW -f link | awk '{ print $1, $4 }'", $linkinfo); array_shift($linkinfo); /* build ip address list with netstat */ + $ipinfo = ""; exec("/usr/bin/netstat -inW -f inet | awk '{ print $1, $4 }'", $ipinfo); array_shift($ipinfo); foreach($linkinfo as $link) { @@ -330,7 +333,8 @@ function get_interface_list($mode = "active", $keyby = "physical", $vfaces = "") function mwexec($command) { global $g; - + $oarr = ""; + $retval = ""; if ($g['debug']) { if (!$_SERVER['REMOTE_ADDR']) echo "mwexec(): $command\n"; @@ -490,6 +494,7 @@ function verify_digital_signature($fname) { /* obtain MAC address given an IP address by looking at the ARP table */ function arp_get_mac_by_ip($ip) { mwexec("/sbin/ping -c 1 -t 1 {$ip}"); + $arpoutput = ""; exec("/usr/sbin/arp -n {$ip}", $arpoutput); if ($arpoutput[0]) { diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index 18bc8a4..c98462a 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -69,6 +69,7 @@ function vpn_ipsec_failover_configure() { } function find_last_gif_device() { + $regs = ""; $last_gif_found = -1; if (!($fp = popen("/sbin/ifconfig -l", "r"))) return -1; $ifconfig_data = fread($fp, 4096); @@ -85,7 +86,7 @@ function find_last_gif_device() { } function vpn_ipsec_configure($ipchg = false) { - global $config, $g; + global $config, $g, $sa, $sn; if($g['booting'] == true) { /* determine if we should load the via padlock module */ diff --git a/etc/inc/xmlrpc_client.inc b/etc/inc/xmlrpc_client.inc index 9b5b655..6b58b1f 100644 --- a/etc/inc/xmlrpc_client.inc +++ b/etc/inc/xmlrpc_client.inc @@ -729,6 +729,7 @@ class XML_RPC_Client extends XML_RPC_Base { $this->proxy_user = $proxy_user; $this->proxy_pass = $proxy_pass; + $match = ""; preg_match('@^(http://|https://|ssl://)?(.*)$@', $server, $match); if ($match[1] == '') { if ($port == 443) { @@ -1297,7 +1298,7 @@ class XML_RPC_Message extends XML_RPC_Base function getEncoding($data) { global $XML_RPC_defencoding; - + $match = ""; if (preg_match('/<\?xml[^>]*\s*encoding\s*=\s*[\'"]([^"\']*)[\'"]/i', $data, $match)) { @@ -1834,6 +1835,7 @@ function XML_RPC_iso8601_encode($timet, $utc = 0) function XML_RPC_iso8601_decode($idate, $utc = 0) { $t = 0; + $regs = ""; if (ereg('([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})', $idate, $regs)) { if ($utc) { $t = gmmktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); diff --git a/usr/local/captiveportal/radius_accounting.inc b/usr/local/captiveportal/radius_accounting.inc index 14264f6..9744809 100644 --- a/usr/local/captiveportal/radius_accounting.inc +++ b/usr/local/captiveportal/radius_accounting.inc @@ -35,6 +35,7 @@ */ function RADIUS_ACCOUNTING_START($username,$sessionid,$radiusip,$radiusport,$radiuskey,$clientip) { + global $debug, $nasHostname, $errstr; $sharedsecret=$radiuskey ; # $debug = 1 ; @@ -42,6 +43,7 @@ function RADIUS_ACCOUNTING_START($username,$sessionid,$radiusip,$radiusport,$rad if(!$nasHostname[0]) $nasHostname[0] = "m0n0wall" ; + $errno = ""; $fd = @fsockopen("udp://$radiusip",$radiusport,$errno,$errstr,3) ; if(!$fd) return 1 ; /* error return */ @@ -137,8 +139,9 @@ function RADIUS_ACCOUNTING_START($username,$sessionid,$radiusip,$radiusport,$rad function RADIUS_ACCOUNTING_STOP($ruleno,$username,$sessionid,$start_time,$radiusip,$radiusport,$radiuskey,$clientip,$interimupdate=false) { $sharedsecret=$radiuskey ; + global $debug, $errno, $ipfw, $errstr,$nasHostname; + $matches = ""; # $debug = 1 ; - exec("/bin/hostname", $nasHostname) ; if(!$nasHostname[0]) $nasHostname[0] = "quewall" ; diff --git a/usr/local/captiveportal/radius_authentication.inc b/usr/local/captiveportal/radius_authentication.inc index c106da3..86e5bfe 100644 --- a/usr/local/captiveportal/radius_authentication.inc +++ b/usr/local/captiveportal/radius_authentication.inc @@ -30,6 +30,7 @@ function RADIUS_AUTHENTICATION($username,$password,$radiusip,$radiusport,$radiuskey) { $sharedsecret=$radiuskey ; + global $debug, $errno, $nasHostname, $errstr; # $debug = 1 ; exec("/bin/hostname", $nasHostname) ; diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php index ae766b4..19b2f45 100755 --- a/usr/local/www/diag_logs_filter.php +++ b/usr/local/www/diag_logs_filter.php @@ -56,7 +56,7 @@ function conv_clog($logfile, $tail = 50) { $iftable[$config['interfaces']['opt' . $i]['if']] = $config['interfaces']['opt' . $i]['descr']; $sor = isset($config['syslog']['reverse']) ? "-r" : ""; - + $logarr = ""; exec("/usr/sbin/clog {$logfile} | /usr/bin/tail {$sor} -n 500", $logarr); $filterlog = array(); diff --git a/usr/local/www/diag_ping.php b/usr/local/www/diag_ping.php index 81d2f7a..5dee4d6 100755 --- a/usr/local/www/diag_ping.php +++ b/usr/local/www/diag_ping.php @@ -71,6 +71,8 @@ function get_interface_addr($ifdescr) { $if = $config['interfaces'][$ifdescr]['if']; /* try to determine IP address and netmask with ifconfig */ + $ifconfiginfo = ""; + $matches = ""; unset($ifconfiginfo); exec("/sbin/ifconfig " . $if, $ifconfiginfo); diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index 81dcb7d..9f581d1 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -172,7 +172,8 @@ function exec_rc_script($scriptname) { if (file_exists($d_sysrebootreqd_path)) return 0; - + $execoutput = ""; + $retval = ""; exec($scriptname . " >/dev/null 2>&1", $execoutput, $retval); return $retval; } @@ -180,7 +181,8 @@ function exec_rc_script($scriptname) { function exec_rc_script_async($scriptname) { global $d_sysrebootreqd_path; - + $execoutput = ""; + $retval = ""; if (file_exists($d_sysrebootreqd_path)) return 0; @@ -548,7 +550,8 @@ function update_changedesc($update) { function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert = "") { global $g, $config; - $sor = isset($config['syslog']['reverse']) ? "-r" : ""; + $sor = isset($config['syslog']['reverse']) ? "-r" : ""; + $logarr = ""; exec("/usr/sbin/clog {$logfile} | /usr/bin/tail {$sor} -n {$tail}", $logarr); if(is_array($grepfor)) { $i = 0; diff --git a/usr/local/www/includes/functions.inc.php b/usr/local/www/includes/functions.inc.php index d87adcc..6abbf75 100644 --- a/usr/local/www/includes/functions.inc.php +++ b/usr/local/www/includes/functions.inc.php @@ -20,6 +20,8 @@ function get_stats() { function get_uptime() { + $boottime = ""; + $matches = ""; exec("/sbin/sysctl -n kern.boottime", $boottime); preg_match("/sec = (\d+)/", $boottime[0], $matches); $boottime = $matches[1]; @@ -67,15 +69,16 @@ function cpu_usage() { function get_pfstate() { global $config; - if (isset($config['system']['maximumstates']) and $config['system']['maximumstates'] > 0) - $maxstates="/{$config['system']['maximumstates']}"; - else - $maxstates="/10000"; - $curentries = `/sbin/pfctl -si |grep current`; - if (preg_match("/([0-9]+)/", $curentries, $matches)) { - $curentries = $matches[1]; - } - return $curentries . $maxstates; + $matches = ""; + if (isset($config['system']['maximumstates']) and $config['system']['maximumstates'] > 0) + $maxstates="/{$config['system']['maximumstates']}"; + else + $maxstates="/10000"; + $curentries = `/sbin/pfctl -si |grep current`; + if (preg_match("/([0-9]+)/", $curentries, $matches)) { + $curentries = $matches[1]; + } + return $curentries . $maxstates; } function has_temp() { @@ -111,6 +114,7 @@ function get_temp() { function disk_usage() { + $dfout = ""; exec("/bin/df -h | /usr/bin/grep -w '/' | /usr/bin/awk '{ print $5 }' | /usr/bin/cut -d '%' -f 1", $dfout); $diskusage = trim($dfout[0]); @@ -129,6 +133,7 @@ function swap_usage() function mem_usage() { + $memory = ""; exec("/sbin/sysctl -n vm.stats.vm.v_page_count vm.stats.vm.v_inactive_count " . "vm.stats.vm.v_cache_count vm.stats.vm.v_free_count", $memory); diff --git a/usr/local/www/interfaces_wlan.inc b/usr/local/www/interfaces_wlan.inc index 56ca5cf..955b818 100755 --- a/usr/local/www/interfaces_wlan.inc +++ b/usr/local/www/interfaces_wlan.inc @@ -79,7 +79,7 @@ function wireless_config_init() { } function wireless_config_post() { - global $optcfg, $pconfig; + global $optcfg, $pconfig, $input_errors; unset($input_errors); diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php index 244df30..90e938e 100755 --- a/usr/local/www/pkg_edit.php +++ b/usr/local/www/pkg_edit.php @@ -600,11 +600,12 @@ function fixup_string($string) { */ function parse_package_templates() { global $pkg, $config; + $rows = 0; if($pkg['templates']['template'] <> "") foreach($pkg['templates']['template'] as $pkg_template_row) { $filename = $pkg_template_row['filename']; $template_text = $pkg_template_row['templatecontents']; - + $firstfield = ""; /* calculate total row helpers count */ foreach ($pkg['fields']['field'] as $fields) { if($fields['type'] == "rowhelper") { @@ -618,6 +619,7 @@ function parse_package_templates() { if($firstfield == $rowhelperfield['fieldname']) $rows++; } $comd = "\$value = \$_POST['" . $rowhelperfield['fieldname'] . $x . "'];"; + $value = ""; eval($comd); if($value <> "") { //$template_text = str_replace($fieldname . "_fieldvalue", $fieldvalue, $template_text); @@ -653,6 +655,7 @@ function parse_package_templates() { $row_helper_data .= $value; $isfirst = 1; } + $sep = ""; ereg($rowhelperfield['fieldname'] . "_fieldvalue\[(.*)\]", $template_text, $sep); foreach ($sep as $se) $seperator = $se; if($seperator <> "") { diff --git a/usr/local/www/services_dhcp_relay.php b/usr/local/www/services_dhcp_relay.php index cb2497a..01daadc 100755 --- a/usr/local/www/services_dhcp_relay.php +++ b/usr/local/www/services_dhcp_relay.php @@ -34,6 +34,9 @@ function get_wan_dhcp_server() { $dhclientfn = $g['vardb_path'] . "/dhclient.leases"; $leases = file($dhclientfn); /* Start at the end, work backwards finding the latest lease for the WAN */ + $dhcpserver = ""; + $iface = ""; + $iface = ""; for ($i = (count($leases)-1); $i >= 0; $i--) { if ($leases[$i] == "}") { unset($iface); diff --git a/usr/local/www/status.php b/usr/local/www/status.php index 287c1a3..f33e171 100755 --- a/usr/local/www/status.php +++ b/usr/local/www/status.php @@ -37,6 +37,8 @@ function doCmdT($title, $command) { } fclose($fd); } else { + $execOutput = ""; + $execStatus = ""; exec ($command . " 2>&1", $execOutput, $execStatus); for ($i = 0; isset($execOutput[$i]); $i++) { if ($i > 0) { diff --git a/usr/local/www/status_interfaces.php b/usr/local/www/status_interfaces.php index cf37e26..5dcd57b 100755 --- a/usr/local/www/status_interfaces.php +++ b/usr/local/www/status_interfaces.php @@ -62,7 +62,7 @@ if ($_POST) { function get_interface_info($ifdescr) { - global $config; + global $config, $linkinfo, $netstatrninfo; $ifinfo = array(); @@ -74,6 +74,7 @@ function get_interface_info($ifdescr) { $ifinfo['if'] = $ifinfo['hwif']; /* run netstat to determine link info */ + unset($linkinfo); exec("/usr/bin/netstat -I " . $ifinfo['hwif'] . " -nWb -f link", $linkinfo); $linkinfo = preg_split("/\s+/", $linkinfo[1]); @@ -128,6 +129,7 @@ function get_interface_info($ifdescr) { $ifinfo['pppoelink'] = "down"; } else { /* get PPPoE link status for dial on demand */ + $ifconfiginfo = ""; unset($ifconfiginfo); exec("/sbin/ifconfig " . $ifinfo['if'], $ifconfiginfo); @@ -165,7 +167,7 @@ function get_interface_info($ifdescr) { /* try to determine media with ifconfig */ unset($ifconfiginfo); exec("/sbin/ifconfig " . $ifinfo['hwif'], $ifconfiginfo); - + $matches = ""; foreach ($ifconfiginfo as $ici) { if (!isset($config['interfaces'][$ifdescr]['wireless'])) { /* don't list media/speed for wireless cards, as it always -- cgit v1.1