From be405bd3465d4c98d18ee2347be0ec01cbcfecb8 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 5 May 2015 14:22:35 -0300 Subject: Refactory squid_get_real_interface_address keeping result the same but using pfSense generic functions instead of calling ifconfig --- config/squid3/34/squid.inc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'config') 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) { -- cgit v1.2.3