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 | |
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')
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 12 | ||||
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index e7c91b1a..27f801a5 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) diff --git a/accel-pppd/ctrl/ipoe/ipoe.h b/accel-pppd/ctrl/ipoe/ipoe.h index 085aeda6..827cba31 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.h +++ b/accel-pppd/ctrl/ipoe/ipoe.h @@ -56,6 +56,7 @@ struct ipoe_session int ifindex; struct ipv4db_item_t ipv4; int ifcfg:1; + int terminating:1; int dhcp_addr:1; int relay_addr:1; int l4_redirect:1; |