summaryrefslogtreecommitdiffstats
path: root/etc/inc/captiveportal.inc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/inc/captiveportal.inc')
-rw-r--r--etc/inc/captiveportal.inc21
1 files changed, 16 insertions, 5 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 83d8b31..1b34717 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -1248,10 +1248,21 @@ function getNasID()
function getNasIP()
{
- $nasIp = get_interface_ip();
- if(!$nasIp)
- $nasIp = "0.0.0.0";
- return $nasIp;
+ global $config;
+
+ if (empty($config['captiveportal']['radiussrcip_attribute']))
+ $nasIp = get_interface_ip();
+ else {
+ if (is_ipaddr($config['captiveportal']['radiussrcip_attribute']))
+ $nasIp = $config['captiveportal']['radiussrcip_attribute'];
+ else
+ $nasIp = get_interface_ip($config['captiveportal']['radiussrcip_attribute']);
+ }
+
+ if(!is_ipaddr($nasIp))
+ $nasIp = "0.0.0.0";
+
+ return $nasIp;
}
function portal_ip_from_client_ip($cliip) {
@@ -1278,4 +1289,4 @@ function portal_ip_from_client_ip($cliip) {
return false;
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud