diff options
author | Ermal <eri@pfsense.org> | 2012-01-20 12:22:41 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2012-01-20 12:23:20 +0000 |
commit | 212ab80f689b35f9ddc3baea153970de26c924ea (patch) | |
tree | 3f397ccf0550e2f5cb88106e91a85be260e5f851 /usr | |
parent | cff5204a17992f77de04544f75f939ddcfabf84c (diff) | |
download | pfsense-212ab80f689b35f9ddc3baea153970de26c924ea.zip pfsense-212ab80f689b35f9ddc3baea153970de26c924ea.tar.gz |
Correct the Called-Station-Id attribute setting to be the consistent on authentication packets
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/captiveportal/radius_authentication.inc | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/usr/local/captiveportal/radius_authentication.inc b/usr/local/captiveportal/radius_authentication.inc index da09fdc..cb21a23 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 --------------------- @@ -68,10 +95,7 @@ function RADIUS_AUTHENTICATION($username,$password,$radiusservers,$clientip,$cli $callingstationid = $clientip; break; default: - if (is_ipaddr($config['captiveportal'][$cpzone]['radiussrcip_attribute'])) - $calledstationid = $config['captiveportal'][$cpzone]['radiussrcip_attribute']; - else - $calledstationid = get_interface_ip($config['captiveportal'][$cpzone]['radiussrcip_attribute']); + $calledstationid = getNasIP(); $callingstationid = $clientmac; break; } |