summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2013-03-18 16:03:10 +0400
committerDmitry Kozlov <xeb@mail.ru>2013-03-18 16:03:10 +0400
commit7a1b1120184e627a4465e5131e04e98b54e04f7d (patch)
treeb5dfae041140e7d41bccf3a7fcf9dce2eddeee1f
parent0052d20e94d87016e71cf9ae6c8d9329577eb74b (diff)
downloadaccel-ppp-7a1b1120184e627a4465e5131e04e98b54e04f7d.tar.gz
accel-ppp-7a1b1120184e627a4465e5131e04e98b54e04f7d.zip
ipoe: early drop routes when dropping sessions (V3)
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c9
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index e7c91b1..ff18370 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)
@@ -1296,6 +1299,12 @@ static void ipoe_drop_sessions(struct ipoe_serv *serv, struct ipoe_session *skip
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);
diff --git a/accel-pppd/ctrl/ipoe/ipoe.h b/accel-pppd/ctrl/ipoe/ipoe.h
index 085aeda..827cba3 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;