From 28777b9b70377e47b037cb28351b47cc4f82854a Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Mon, 2 Nov 2015 15:21:52 +0300 Subject: ipoe: implemented username=ifname for UP sessions --- accel-pppd/ctrl/ipoe/ipoe.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'accel-pppd/ctrl/ipoe/ipoe.c') diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 8b28c76c..d287604b 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -1803,8 +1803,12 @@ static struct ipoe_session *ipoe_session_create_up(struct ipoe_serv *serv, struc u_inet_ntoa(iph->saddr, ses->ctrl.calling_station_id); } - ses->username = _malloc(17); - u_inet_ntoa(iph->saddr, ses->username); + if (ses->serv->opt_username == USERNAME_IFNAME) + ses->username = _strdup(serv->ifname); + else { + ses->username = _malloc(17); + u_inet_ntoa(iph->saddr, ses->username); + } ses->ses.chan_name = ses->ctrl.calling_station_id; -- cgit v1.2.3