summaryrefslogtreecommitdiff
path: root/accel-pppd/radius/radius.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2016-07-09 13:40:35 +0300
committerDmitry Kozlov <xeb@mail.ru>2016-07-09 13:40:35 +0300
commit81df5d567b747b2af12a1c2fa2a330899b22821b (patch)
tree9a98f0f2007deae10896b29c95ff03e013ddcb65 /accel-pppd/radius/radius.c
parent1380198e91cad0442ea9f0cf708ffd6a8a5fcacb (diff)
downloadaccel-ppp-81df5d567b747b2af12a1c2fa2a330899b22821b.tar.gz
accel-ppp-81df5d567b747b2af12a1c2fa2a330899b22821b.zip
radius: do not execute interface rename immediately, store new name for later use
Bacause interface may not still exists in authentication phase
Diffstat (limited to 'accel-pppd/radius/radius.c')
-rw-r--r--accel-pppd/radius/radius.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/accel-pppd/radius/radius.c b/accel-pppd/radius/radius.c
index c8e30ebd..eede9067 100644
--- a/accel-pppd/radius/radius.c
+++ b/accel-pppd/radius/radius.c
@@ -232,7 +232,11 @@ int rad_proc_attrs(struct rad_req_t *req)
rpd->ses->unit_idx = attr->val.integer;
break;
case NAS_Port_Id:
- ap_session_rename(rpd->ses, attr->val.string, attr->len);
+ if (rpd->ses->ifname_rename)
+ _free(rpd->ses->ifname_rename);
+ rpd->ses->ifname_rename = _malloc(attr->len + 1);
+ memcpy(rpd->ses->ifname_rename, attr->val.string, attr->len);
+ rpd->ses->ifname_rename[attr->len] = 0;
break;
case Framed_Route:
parse_framed_route(rpd, attr->val.string);