From e6a933153da8ddfb78da9a191d509378bb5dc114 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 18 Jan 2024 10:13:00 +0100 Subject: [PATCH] RA: announce after the actions which may be dropping the session It's useless to announce RA just before dropping the session. --- l2tpns.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/l2tpns.c b/l2tpns.c index ad25a1d..baa1a50 100644 --- a/l2tpns.c +++ b/l2tpns.c @@ -3846,14 +3846,6 @@ static void regular_cleanups(double period) s_actions++; } - // Send periodic RA - if (session[s].ppp.phase == Network && session[s].ppp.ipv6cp == Opened && - (time_now - sess_local[s].last_ra >= RtrAdvInterval)) - { - send_ipv6_ra(s, t, NULL); - sess_local[s].last_ra = time_now; - } - // Drop sessions who have reached session_timeout seconds if (session[s].session_timeout) { @@ -3967,6 +3959,14 @@ static void regular_cleanups(double period) cluster_send_session(s); } + // Send periodic RA + if (session[s].ppp.phase == Network && session[s].ppp.ipv6cp == Opened && + (time_now - sess_local[s].last_ra >= RtrAdvInterval)) + { + send_ipv6_ra(s, t, NULL); + sess_local[s].last_ra = time_now; + } + // RADIUS interim accounting if (config->radius_accounting && config->radius_interim > 0 && session[s].ip && !session[s].walled_garden