From 81df5d567b747b2af12a1c2fa2a330899b22821b Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Sat, 9 Jul 2016 13:40:35 +0300 Subject: radius: do not execute interface rename immediately, store new name for later use Bacause interface may not still exists in authentication phase --- accel-pppd/radius/radius.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'accel-pppd/radius') 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); -- cgit v1.2.3