summaryrefslogtreecommitdiff
path: root/accel-pppd/radius/req.c
diff options
context:
space:
mode:
authorVladislav Grishenko <themiron@mail.ru>2019-08-29 17:37:15 +0500
committerVladislav Grishenko <themiron@mail.ru>2019-08-29 17:37:15 +0500
commitb955a5c1b35268afd1f6f7ae6aa28ab8e091e28d (patch)
tree950aab4d85e132e4d230dffcbc853dacbbce3ad4 /accel-pppd/radius/req.c
parent7efdbf43b172abe58e703d09fc8f317bf0da0000 (diff)
downloadaccel-ppp-b955a5c1b35268afd1f6f7ae6aa28ab8e091e28d.tar.gz
accel-ppp-b955a5c1b35268afd1f6f7ae6aa28ab8e091e28d.zip
radius: add support for Access-Accept username
once radius server has returned User-Name attribute in Access-Accept packet, it'll be used for any subsequent Accounting-Request packets instead of internal username per RFC2865 5.1 other way of just replacing session username is possible, but not desired at the moment due potential issues with single-session modes in case of different ppp logins / ipoe macs and same contract number returned by radius for that accounts.
Diffstat (limited to 'accel-pppd/radius/req.c')
-rw-r--r--accel-pppd/radius/req.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/accel-pppd/radius/req.c b/accel-pppd/radius/req.c
index b6c4cf0..b9b6536 100644
--- a/accel-pppd/radius/req.c
+++ b/accel-pppd/radius/req.c
@@ -72,6 +72,9 @@ static struct rad_req_t *__rad_req_alloc(struct radius_pd_t *rpd, int code, cons
if (!req->pack)
goto out_err;
+ if (code == CODE_ACCOUNTING_REQUEST && rpd->acct_username)
+ username = rpd->acct_username;
+
if (rad_packet_add_str(req->pack, NULL, "User-Name", username))
goto out_err;