From 722bf12382aea5e49d49c01b61ac7f830fe86c93 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Tue, 20 Oct 2015 10:41:22 +0200 Subject: Remove broken IP detection code and force localhost --- config/lightsquid/sqstat.php | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/config/lightsquid/sqstat.php b/config/lightsquid/sqstat.php index 18fa2d25..5d3a0e83 100644 --- a/config/lightsquid/sqstat.php +++ b/config/lightsquid/sqstat.php @@ -355,23 +355,14 @@ function sqstat_loadconfig() { $squidclass->sqstat_version = SQSTAT_VERSION; - /* Load config from pfSense */ $iface = '127.0.0.1'; + /* Load config from pfSense and find proxy port */ $iport = 3128; if (is_array($config['installedpackages']['squid']['config'][0])) { $squid_settings = $config['installedpackages']['squid']['config'][0]; } else { $squid_settings = array(); } - - // Squid interface IP & port - $realif = array(); - $iface = ($squid_settings['active_interface'] ? $squid_settings['active_interface'] : 'lan'); - $iface = explode(",", $iface); - foreach ($iface as $i => $if) { - $realif[] = sqstat_get_real_interface_address($if); - $iface = $realif[$i][0] ? $realif[$i][0] : '127.0.0.1'; - } $iport = $squid_settings['proxy_port'] ? $squid_settings['proxy_port'] : 3128; $squidclass->squidhost = $iface; @@ -391,14 +382,4 @@ function sqstat_loadconfig() { return $squidclass->errno; } -function sqstat_get_real_interface_address($iface) { - global $config; - - $iface = convert_friendly_interface_to_real_interface_name($iface); - $line = trim(shell_exec("ifconfig $iface | grep inet | grep -v inet6")); - list($dummy, $ip, $dummy2, $netmask) = explode(" ", $line); - - return array($ip, long2ip(hexdec($netmask))); -} - ?> -- cgit v1.2.3