uspot: move RADIUS NAS_PORT_TYPE to portal.uc

Currently still hardcoded to "19" aka Wireless.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
This commit is contained in:
Thibaut VARÈNE
2023-05-23 10:34:37 +02:00
committed by John Crispin
parent 78c7a3cbfa
commit 3219fceb48
2 changed files with 4 additions and 5 deletions

View File

@@ -230,6 +230,7 @@ return {
calling_station: ctx.format_mac,
nas_ip: ctx.env.SERVER_ADDR,
nas_id: ctx.config.nasid,
nas_port_type: 19, // wireless
};
if (ctx.config.location_name)

View File

@@ -45,6 +45,7 @@ enum {
RADIUS_PROXY_STATE_ACCT,
RADIUS_PROXY_STATE_AUTH,
RADIUS_LOCATION_NAME,
RADIUS_NAS_PORT_TYPE,
__RADIUS_MAX,
};
@@ -77,6 +78,7 @@ static const struct blobmsg_policy radius_policy[__RADIUS_MAX] = {
[RADIUS_PROXY_STATE_AUTH] = { .name = "auth_proxy", .type = BLOBMSG_TYPE_STRING },
[RADIUS_PROXY_STATE_ACCT] = { .name = "acct_proxy", .type = BLOBMSG_TYPE_STRING },
[RADIUS_LOCATION_NAME] = { .name = "location_name", .type = BLOBMSG_TYPE_STRING },
[RADIUS_NAS_PORT_TYPE] = { .name = "nas_port_type", .type = BLOBMSG_TYPE_INT32 },
};
static struct blob_buf b = {};
@@ -126,6 +128,7 @@ static const struct {
[RADIUS_PROXY_STATE_AUTH] = { .attrid = PW_PROXY_STATE, },
[RADIUS_PROXY_STATE_ACCT] = { .attrid = PW_PROXY_STATE, },
[RADIUS_LOCATION_NAME] = { .attrid = ATTR_WBAL_WISPR_LOCATION_NAME, .vendorspec = VENDORSPEC_WBAL, },
[RADIUS_NAS_PORT_TYPE] = { .attrid = PW_NAS_PORT_TYPE, },
};
/**
@@ -312,11 +315,6 @@ radius(void)
}
}
val = 19;
if (rc_avpair_add(rh, &send, PW_NAS_PORT_TYPE, &val, 4, 0) == NULL)
goto fail;
rc_apply_config(rh);
if (tb[RADIUS_ACCT] && blobmsg_get_bool(tb[RADIUS_ACCT])) {
if (rc_acct(rh, 0, send) == OK_RC)
return result(rh, 1, NULL);