diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2015-11-02 15:21:52 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2015-11-02 15:21:52 +0300 |
commit | 28777b9b70377e47b037cb28351b47cc4f82854a (patch) | |
tree | d0bad85db5087360c06d52c148b3738098e7d069 | |
parent | 30cff41b56be0d4c3e407e8aa4de5b289eef2ab0 (diff) | |
download | accel-ppp-28777b9b70377e47b037cb28351b47cc4f82854a.tar.gz accel-ppp-28777b9b70377e47b037cb28351b47cc4f82854a.zip |
ipoe: implemented username=ifname for UP sessions
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 8b28c76..d287604 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; |