From 27c2e32e28f871adf036b666e8e3ae1bf54ea7a2 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 6 Nov 2014 16:38:00 -0200 Subject: [PATCH] Pass zone id to pfSense_ipfw_getTablestats(), should fix #3990 --- etc/inc/captiveportal.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 85a14bdf3..25990c37f 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -1128,9 +1128,9 @@ function captiveportal_allowedip_configure() { /* get last activity timestamp given client IP address */ function captiveportal_get_last_activity($ip, $mac = NULL) { - global $cpzone; + global $cpzoneid; - $ipfwoutput = pfSense_ipfw_getTablestats($cpzone, 1, $ip, $mac); + $ipfwoutput = pfSense_ipfw_getTablestats($cpzoneid, 1, $ip, $mac); /* Reading only from one of the tables is enough of approximation. */ if (is_array($ipfwoutput)) { return $ipfwoutput['timestamp']; @@ -1588,14 +1588,14 @@ function captiveportal_get_ipfw_passthru_ruleno($value) { */ function getVolume($ip, $mac = NULL) { - global $config, $cpzone; + global $config, $cpzone, $cpzoneid; $reverse = empty($config['captiveportal'][$cpzone]['reverseacct']) ? false : true; $volume = array(); // Initialize vars properly, since we don't want NULL vars $volume['input_pkts'] = $volume['input_bytes'] = $volume['output_pkts'] = $volume['output_bytes'] = 0 ; - $ipfw = pfSense_ipfw_getTablestats($cpzone, 1, $ip, $mac); + $ipfw = pfSense_ipfw_getTablestats($cpzoneid, 1, $ip, $mac); if (is_array($ipfw)) { if ($reverse) { $volume['output_pkts'] = $ipfw['packets']; @@ -1607,7 +1607,7 @@ function getVolume($ip, $mac = NULL) { } } - $ipfw = pfSense_ipfw_getTablestats($cpzone, 2, $ip); + $ipfw = pfSense_ipfw_getTablestats($cpzoneid, 2, $ip); if (is_array($ipfw)) { if ($reverse) { $volume['input_pkts'] = $ipfw['packets'];