diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2013-03-18 14:22:52 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2013-03-18 14:22:52 +0400 |
commit | 3108115ec7816c99e737d3623a2fb63875af058e (patch) | |
tree | 6100015b6501029b1b70b5b4bb550edc50e553df /accel-pppd/ctrl/ipoe/ipoe.c | |
parent | 751477d72cb49656cc6d7d35d91b21da3be3314e (diff) | |
download | accel-ppp-3108115ec7816c99e737d3623a2fb63875af058e.tar.gz accel-ppp-3108115ec7816c99e737d3623a2fb63875af058e.zip |
ipoe: early drop routes when dropping sessions
Diffstat (limited to 'accel-pppd/ctrl/ipoe/ipoe.c')
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index e7c91b1..27f801a 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -576,6 +576,9 @@ static void __ipoe_session_activate(struct ipoe_session *ses) { uint32_t addr; + if (ses->terminating) + return; + if (ses->ifindex != -1) { addr = 0; if (!ses->ses.ipv4) @@ -1292,15 +1295,24 @@ static void ipoe_drop_sessions(struct ipoe_serv *serv, struct ipoe_session *skip { struct ipoe_session *ses; + pthread_mutex_lock(&serv->lock); list_for_each_entry(ses, &serv->sessions, entry) { if (ses == skip) continue; + ses->terminating = 1; + if (ses->ifcfg) { + ipoe_ifcfg_del(ses); + ses->ifcfg = 0; + } + if (ses->ses.state == AP_STATE_ACTIVE) ap_session_ifdown(&ses->ses); triton_context_call(&ses->ctx, (triton_event_func)__terminate, &ses->ses); } + pthread_mutex_unlock(&serv->lock); + } struct ipoe_serv *ipoe_find_serv(const char *ifname) |