From a478611de8d0454389225d296a0c210d261a1b5b Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Thu, 24 Jan 2013 16:14:08 +0100 Subject: l2tp: Perform session disconnection in ppp context PPP and L2TP session contexts are the same. So since l2tp_ppp_finished() is called within the PPP context, it doesn't need to switch to the session context for calling l2tp_ppp_session_disconnect(). Signed-off-by: Guillaume Nault --- accel-pppd/ctrl/l2tp/l2tp.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'accel-pppd') diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index 1ad5a81..f09aaed 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -403,10 +403,11 @@ static int l2tp_session_disconnect(struct l2tp_sess_t *sess, return 0; } -static void l2tp_ppp_session_disconnect(void *param) +static void l2tp_ppp_finished(struct ap_session *ses) { - struct l2tp_sess_t *sess = param; + struct l2tp_sess_t *sess = l2tp_session_self(); + log_ppp_debug("l2tp: ppp finished\n"); if (sess->state1 != STATE_CLOSE) { l2tp_send_CDN(sess, 2, 0); l2tp_session_free(sess); @@ -422,15 +423,6 @@ static void l2tp_ppp_started(struct ap_session *ses) log_ppp_debug("l2tp: ppp started\n"); } -static void l2tp_ppp_finished(struct ap_session *ses) -{ - struct ppp_t *ppp = container_of(ses, typeof(*ppp), ses); - struct l2tp_sess_t *sess = container_of(ppp, typeof(*sess), ppp); - - log_ppp_debug("l2tp: ppp finished\n"); - triton_context_call(&sess->sctx, l2tp_ppp_session_disconnect, sess); -} - static void l2tp_session_timeout(struct triton_timer_t *t) { struct l2tp_sess_t *sess = container_of(t, typeof(*sess), -- cgit v1.2.3