summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-05-18 01:04:19 +0000
committerDmitry Kozlov <xeb@mail.ru>2014-05-18 02:15:25 +0000
commitd5c3630d92b329735048b228878bb3ae137799cc (patch)
tree2e7ae38e67170ef8f7ce502e40e3d6fbecd06903 /accel-pppd/ctrl
parentec41e172a9da0de7cf5c28027928c698d0d1ebf8 (diff)
downloadaccel-ppp-d5c3630d92b329735048b228878bb3ae137799cc.tar.gz
accel-ppp-d5c3630d92b329735048b228878bb3ae137799cc.zip
improved single-session=replace handling
Wait for previous session completely terminated before continuing authorization new session.
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c5
-rw-r--r--accel-pppd/ctrl/ipoe/lua.c6
2 files changed, 7 insertions, 4 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index 375e6c58..a7db155b 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -321,7 +321,8 @@ static void ipoe_session_set_username(struct ipoe_session *ses)
ipoe_lua_set_username(ses, ses->serv->opt_lua_username_func ? : conf_lua_username_func);
} else
#endif
- ses->ses.username = _strdup(ses->ses.ifname);
+
+ ap_session_set_username(&ses->ses, _strdup(ses->ses.ifname));
}
static void l4_redirect_list_add(in_addr_t addr, int ifindex)
@@ -1547,7 +1548,7 @@ static struct ipoe_session *ipoe_session_create_up(struct ipoe_serv *serv, struc
ses->ses.chan_name = ses->ctrl.calling_station_id;
if (conf_username == USERNAME_UNSET)
- ses->ses.username = _strdup(ses->ctrl.calling_station_id);
+ ap_session_set_username(&ses->ses, _strdup(ses->ctrl.calling_station_id));
if (conf_ip_pool)
ses->ses.ipv4_pool_name = _strdup(conf_ip_pool);
diff --git a/accel-pppd/ctrl/ipoe/lua.c b/accel-pppd/ctrl/ipoe/lua.c
index 4fb6380a..b894aa3f 100644
--- a/accel-pppd/ctrl/ipoe/lua.c
+++ b/accel-pppd/ctrl/ipoe/lua.c
@@ -232,6 +232,8 @@ out_err:
int ipoe_lua_set_username(struct ipoe_session *ses, const char *func)
{
+ int r;
+
if (file_error && serial == __serial)
return -1;
@@ -257,11 +259,11 @@ int ipoe_lua_set_username(struct ipoe_session *ses, const char *func)
goto out_err;
}
- ses->ses.username = _strdup(lua_tostring(L, -1));
+ r = ap_session_set_username(&ses->ses, _strdup(lua_tostring(L, -1)));
lua_settop(L, 0);
- return 0;
+ return r;
out_err:
file_error = 1;