aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2015-05-05 14:22:35 -0300
committerRenato Botelho <garga@FreeBSD.org>2015-05-05 17:19:09 -0300
commitbe405bd3465d4c98d18ee2347be0ec01cbcfecb8 (patch)
tree69b6c2a66f66650cb3c298c4f167dc768fd27e81
parent55cf46c4ca23dcdb825abee232f4bb8996167cb8 (diff)
downloadpfsense-packages-be405bd3465d4c98d18ee2347be0ec01cbcfecb8.tar.gz
pfsense-packages-be405bd3465d4c98d18ee2347be0ec01cbcfecb8.tar.bz2
pfsense-packages-be405bd3465d4c98d18ee2347be0ec01cbcfecb8.zip
Refactory squid_get_real_interface_address keeping result the same but using pfSense generic functions instead of calling ifconfig
-rwxr-xr-xconfig/squid3/34/squid.inc9
1 files changed, 3 insertions, 6 deletions
diff --git a/config/squid3/34/squid.inc b/config/squid3/34/squid.inc
index 91132db7..83467c42 100755
--- a/config/squid3/34/squid.inc
+++ b/config/squid3/34/squid.inc
@@ -74,13 +74,10 @@ function sq_text_area_decode($text) {
}
function squid_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);
+ if (!function_exists("get_interface_ip"))
+ require_once("interfaces.inc");
- return array($ip, long2ip(hexdec($netmask)));
+ return array(get_interface_ip($iface), gen_subnet_mask(get_interface_subnet($iface)));
}
function squid_chown_recursive($dir, $user, $group) {