summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2018-05-31 16:42:28 +0300
committerDmitry Kozlov <xeb@mail.ru>2018-05-31 16:43:14 +0300
commitd853f52f2ac8987ddc909f3908904d74a54988a2 (patch)
tree7445be66fe6541f182b4e995cd896f67c82aad14
parentd569e0099a97dfbfd1a6157e11bc3089992c4695 (diff)
downloadaccel-ppp-1.11.tar.gz
accel-ppp-1.11.zip
ipoe: use lua function to generate username for UP sessions too1.11
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index 2c9ce3f9..86716bbe 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -1839,6 +1839,10 @@ static struct ipoe_session *ipoe_session_create_up(struct ipoe_serv *serv, struc
if (ses->serv->opt_username == USERNAME_IFNAME)
ses->username = _strdup(serv->ifname);
+#ifdef USE_LUA
+ else if (ses->serv->opt_username == USERNAME_LUA)
+ ses->username = ipoe_lua_get_username(ses, ses->serv->opt_lua_username_func ? : conf_lua_username_func);
+#endif
else {
ses->username = _malloc(17);
u_inet_ntoa(saddr, ses->username);