summaryrefslogtreecommitdiffstats
path: root/usr/local/captiveportal
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2012-01-20 13:29:20 +0000
committerErmal <eri@pfsense.org>2012-01-20 13:29:20 +0000
commitd1fc1182cd6ca801f77d97b7d7752613397eb6b4 (patch)
tree3a619e6897f5bcb2def9d86331d1a27daa1a6736 /usr/local/captiveportal
parent33266794774e972c4f9ed7e34f7748bcf85aa766 (diff)
downloadpfsense-d1fc1182cd6ca801f77d97b7d7752613397eb6b4.zip
pfsense-d1fc1182cd6ca801f77d97b7d7752613397eb6b4.tar.gz
Correct the Called-Station-Id attribute setting to be consistent on the data sent
Diffstat (limited to 'usr/local/captiveportal')
-rw-r--r--usr/local/captiveportal/radius_authentication.inc32
1 files changed, 28 insertions, 4 deletions
diff --git a/usr/local/captiveportal/radius_authentication.inc b/usr/local/captiveportal/radius_authentication.inc
index 142ab0e..f03315f 100644
--- a/usr/local/captiveportal/radius_authentication.inc
+++ b/usr/local/captiveportal/radius_authentication.inc
@@ -41,6 +41,33 @@
pfSense_MODULE: captiveportal
*/
+/**
+ * Get the NAS-IP-Address based on the current wan address
+ *
+ * Use functions in interfaces.inc to find this out
+ *
+ */
+if (!function_exists('getNasIP')) {
+ function getNasIP()
+ {
+ global $config, $cpzone;
+
+ if (empty($config['captiveportal'][$cpzone]['radiussrcip_attribute'])) {
+ $nasIp = get_interface_ip();
+ } else {
+ if (is_ipaddr($config['captiveportal'][$cpzone]['radiussrcip_attribute']))
+ $nasIp = $config['captiveportal'][$cpzone]['radiussrcip_attribute'];
+ else
+ $nasIp = get_interface_ip($config['captiveportal'][$cpzone]['radiussrcip_attribute']);
+ }
+
+ if(!is_ipaddr($nasIp))
+ $nasIp = "0.0.0.0";
+
+ return $nasIp;
+ }
+}
+
/*
RADIUS AUTHENTICATION
---------------------
@@ -65,10 +92,7 @@ function RADIUS_AUTHENTICATION($username,$password,$radiusservers,$clientip,$cli
$callingstationid = $clientip;
break;
default:
- if (is_ipaddr($config['captiveportal']['radiussrcip_attribute']))
- $calledstationid = $config['captiveportal']['radiussrcip_attribute'];
- else
- $calledstationid = get_interface_ip($config['captiveportal']['radiussrcip_attribute']);
+ $calledstationid = getNasIP();
$callingstationid = $clientmac;
break;
}
OpenPOWER on IntegriCloud