summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c8
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;