diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2013-02-11 21:00:40 +0100 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2013-02-12 00:12:47 +0400 |
commit | 943ea9c42c7aac57a4614f7423a2385918456325 (patch) | |
tree | 2a5f67dbc52faddc31f5bd1ee075bd86125293f8 | |
parent | 08c36cd9ba10be7d5948e0b7050ef10d05321375 (diff) | |
download | accel-ppp-943ea9c42c7aac57a4614f7423a2385918456325.tar.gz accel-ppp-943ea9c42c7aac57a4614f7423a2385918456325.zip |
l2tp: Send EV_CTRL_FINISHED only on established sessions
Don't send the EV_CTRL_FINISHED event when closing sessions which
haven't been established, because no corresponding EV_CTRL_STARTED
events have been sent by such sessions.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
-rw-r--r-- | accel-pppd/ctrl/l2tp/l2tp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index fb166f9..292c403 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -254,7 +254,9 @@ static void __l2tp_session_free(void *data) break; } - triton_event_fire(EV_CTRL_FINISHED, &sess->ppp.ses); + if (sess->state1 == STATE_ESTB || sess->state1 == STATE_CLOSE) + /* Don't send event if session wasn't fully established */ + triton_event_fire(EV_CTRL_FINISHED, &sess->ppp.ses); log_ppp_info1("disconnected\n"); |