From: Brendan O'Dea Date: Mon, 2 May 2005 09:06:05 +0000 (+0000) Subject: Update .last_packet in cluster_handle_bytes only when there have X-Git-Tag: 2.2.1-2fdn3.1~19^2^2~1^2~220 X-Git-Url: http://git.sameswireless.fr/l2tpns.git/commitdiff_plain/7514d053bcbbecf828f9a730081369caba5df3ef Update .last_packet in cluster_handle_bytes only when there have been bytes received from the modem (dead sessions were having the idle timeout reset by stray packets). --- diff --git a/Changes b/Changes index 47dd20f..d35d505 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,4 @@ -* Fri Apr 1 2005 Brendan O'Dea 2.1.0 +* Mon May 2 2005 Brendan O'Dea 2.1.0 - Add IPv6 support from Jonathan McDowell. - Add CHAP support from Jordan Hrycaj (work in progress). - Sanity check that cluster_send_session is not called from a child @@ -40,7 +40,11 @@ (general error, try another LNS) when out of IP addresses, and 3 (adminstrative) for everything else (suggestion from Chris Gates). - Only send RADIUS stop record in sessionshutdown when there's an ip address. -- Reset .die on master takeover. +- Reset .die on master takeover (so that dying sessions don't have to + hang around until the new master has the same uptime as the old one). +- Update .last_packet in cluster_handle_bytes only when there have + been bytes received from the modem (dead sessions were having the + idle timeout reset by stray packets). * Fri Dec 17 2004 Brendan O'Dea 2.0.13 - Better cluster master collision resolution: keep a counter of state diff --git a/cluster.c b/cluster.c index 2d54b7d..2e01a98 100644 --- a/cluster.c +++ b/cluster.c @@ -1,6 +1,6 @@ // L2TPNS Clustering Stuff -char const *cvs_id_cluster = "$Id: cluster.c,v 1.33 2005-04-01 08:55:29 bodea Exp $"; +char const *cvs_id_cluster = "$Id: cluster.c,v 1.34 2005-05-02 09:06:05 bodea Exp $"; #include #include @@ -1037,7 +1037,9 @@ static int cluster_handle_bytes(char *data, int size) session[b->sid].cin += b->in; session[b->sid].cout += b->out; - session[b->sid].last_packet = time_now; // Reset idle timer! + + if (b->in) + session[b->sid].last_packet = time_now; // Reset idle timer! size -= sizeof(*b); ++b; diff --git a/l2tpns.spec b/l2tpns.spec index 846d7c4..86b410f 100644 --- a/l2tpns.spec +++ b/l2tpns.spec @@ -43,5 +43,5 @@ rm -rf %{buildroot} %attr(644,root,root) /usr/share/man/man[58]/* %changelog -* Fri Apr 1 2005 Brendan O'Dea 2.1.0-1 +* Mon May 2 2005 Brendan O'Dea 2.1.0-1 - 2.1.0 release, see /usr/share/doc/l2tpns-2.1.0/Changes