mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-30 01:52:51 +00:00
uspot: introduce mac_passwd and mac_suffix options
This carries over two Chilli options used during mac authentication: - macpasswd, which sets a static password when performing mac-auth - macsuffix, which allows suffixing the mac address provided as username These options are implemented in config uspot section as: - option mac_passwd 'password' - option mac_suffix 'suffix' If unset, this commit is a NOP. Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
This commit is contained in:
committed by
John Crispin
parent
fc80a4aa84
commit
a7341b418e
@@ -19,10 +19,11 @@ function request_start(ctx) {
|
||||
include('radius.uc', ctx);
|
||||
return;
|
||||
case 'uam':
|
||||
// try mac-auth first if enabled
|
||||
if (+ctx.config.mac_auth) {
|
||||
let payload = portal.radius_init(ctx);
|
||||
payload.username = ctx.format_mac;
|
||||
payload.password = ctx.format_mac;
|
||||
payload.username = ctx.format_mac + (ctx.config.mac_suffix || '');
|
||||
payload.password = ctx.config.mac_passwd || ctx.format_mac;
|
||||
payload.service_type = 2;
|
||||
let radius = portal.radius_call(ctx, payload);
|
||||
if (radius['access-accept']) {
|
||||
|
||||
Reference in New Issue
Block a user