Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/sys/net Pull up revision 1.57 (requested by martin in t...



details:   https://anonhg.NetBSD.org/src/rev/34195047909e
branches:  netbsd-1-6
changeset: 530022:34195047909e
user:      tron <tron%NetBSD.org@localhost>
date:      Fri Feb 07 18:28:51 2003 +0000

description:
Pull up revision 1.57 (requested by martin in ticket #1152):
If the peer did not answer LCP echo requests in-time, but we got user
data through within the last LCP keepalive interval, do not count this
as a keepalive failure.
Addresses parts of kern/17723.

diffstat:

 sys/net/if_spppsubr.c |  17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diffs (59 lines):

diff -r 4e6114e421c6 -r 34195047909e sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c     Fri Feb 07 18:25:42 2003 +0000
+++ b/sys/net/if_spppsubr.c     Fri Feb 07 18:28:51 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_spppsubr.c,v 1.46.4.11 2003/02/07 18:25:42 tron Exp $        */
+/*     $NetBSD: if_spppsubr.c,v 1.46.4.12 2003/02/07 18:28:51 tron Exp $        */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.46.4.11 2003/02/07 18:25:42 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.46.4.12 2003/02/07 18:28:51 tron Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipx.h"
@@ -85,7 +85,8 @@
 #include <net/if_sppp.h>
 #include <net/if_spppvar.h>
 
-#define MAXALIVECNT                    3       /* max. alive packets */
+#define        LCP_KEEPALIVE_INTERVAL          10      /* seconds */
+#define MAXALIVECNT                    3       /* max. missed alive packets */
 #define DEFAULT_MAX_AUTH_FAILURES      5       /* max. auth. failures */
 
 /*
@@ -920,7 +921,7 @@
        /* Initialize keepalive handler. */
        if (! spppq) {
                callout_init(&keepalive_ch);
-               callout_reset(&keepalive_ch, hz * 10, sppp_keepalive, NULL);
+               callout_reset(&keepalive_ch, hz * LCP_KEEPALIVE_INTERVAL, sppp_keepalive, NULL);
        }
 
        /* Insert new entry into the keepalive list. */
@@ -4663,6 +4664,12 @@
                    sp->pp_phase < SPPP_PHASE_AUTHENTICATE)
                        continue;
 
+               /* No echo reply, but maybe user data passed through? */
+               if ((now - sp->pp_last_activity) < LCP_KEEPALIVE_INTERVAL) {
+                       sp->pp_alivecnt = 0;
+                       continue;
+               }
+
                if (sp->pp_alivecnt == MAXALIVECNT) {
                        /* No keepalive packets got.  Stop the interface. */
                        if_down (ifp);
@@ -4697,7 +4704,7 @@
                }
        }
        splx(s);
-       callout_reset(&keepalive_ch, hz * 10, sppp_keepalive, NULL);
+       callout_reset(&keepalive_ch, hz * LCP_KEEPALIVE_INTERVAL, sppp_keepalive, NULL);
 }
 
 /*



Home | Main Index | Thread Index | Old Index