Source-Changes-HG archive

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

[src/trunk]: src/sys Introduce SPPP_KEEPALIVE_INTERVAL option



details:   https://anonhg.NetBSD.org/src/rev/78b1d633d678
branches:  trunk
changeset: 379142:78b1d633d678
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Fri May 14 08:06:32 2021 +0000

description:
Introduce SPPP_KEEPALIVE_INTERVAL option
to change the interval between LCP echo requests

diffstat:

 sys/conf/files        |   4 +++-
 sys/net/if_spppsubr.c |  15 ++++++++++-----
 2 files changed, 13 insertions(+), 6 deletions(-)

diffs (79 lines):

diff -r f7cb4f692b2d -r 78b1d633d678 sys/conf/files
--- a/sys/conf/files    Fri May 14 05:15:17 2021 +0000
+++ b/sys/conf/files    Fri May 14 08:06:32 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files,v 1.1279 2021/02/06 16:03:31 dbj Exp $
+#      $NetBSD: files,v 1.1280 2021/05/14 08:06:32 yamaguchi Exp $
 #      @(#)files.newconf       7.5 (Berkeley) 5/10/93
 
 version        20171118
@@ -290,6 +290,8 @@ defflag     opt_ppp.h               PPP_DEFLATE PPP_BSDCO
                                                # packet filtering support
 defflag opt_pppoe.h            PPPOE_SERVER PPPOE_DEBUG
 
+defparam opt_sppp.h            SPPP_KEEPALIVE_INTERVAL
+
 # networking options
 #
 defflag                                GATEWAY
diff -r f7cb4f692b2d -r 78b1d633d678 sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c     Fri May 14 05:15:17 2021 +0000
+++ b/sys/net/if_spppsubr.c     Fri May 14 08:06:32 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_spppsubr.c,v 1.237 2021/05/11 06:42:42 yamaguchi Exp $       */
+/*     $NetBSD: if_spppsubr.c,v 1.238 2021/05/14 08:06:32 yamaguchi Exp $       */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,13 +41,14 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.237 2021/05/11 06:42:42 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.238 2021/05/14 08:06:32 yamaguchi Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
 #include "opt_modular.h"
 #include "opt_compat_netbsd.h"
 #include "opt_net_mpsafe.h"
+#include "opt_sppp.h"
 #endif
 
 #include <sys/param.h>
@@ -96,12 +97,16 @@
 #define SPPPSUBR_MPSAFE        1
 #endif
 
-#define        LCP_KEEPALIVE_INTERVAL          10      /* seconds between checks */
+#define DEFAULT_KEEPALIVE_INTERVAL     10      /* seconds between checks */
 #define LOOPALIVECNT                   3       /* loopback detection tries */
 #define DEFAULT_MAXALIVECNT                    3       /* max. missed alive packets */
 #define        DEFAULT_NORECV_TIME             15      /* before we get worried */
 #define DEFAULT_MAX_AUTH_FAILURES      5       /* max. auth. failures */
 
+#ifndef SPPP_KEEPALIVE_INTERVAL
+#define SPPP_KEEPALIVE_INTERVAL                DEFAULT_KEEPALIVE_INTERVAL
+#endif
+
 /*
  * Interface flags that can be set in an ifconfig command.
  *
@@ -1081,7 +1086,7 @@ sppp_attach(struct ifnet *ifp)
        /* Initialize keepalive handler. */
        if (! spppq) {
                callout_init(&keepalive_ch, CALLOUT_MPSAFE);
-               callout_reset(&keepalive_ch, hz * LCP_KEEPALIVE_INTERVAL, sppp_keepalive, NULL);
+               callout_reset(&keepalive_ch, hz * SPPP_KEEPALIVE_INTERVAL, sppp_keepalive, NULL);
        }
 
        if (! spppq_lock)
@@ -5661,7 +5666,7 @@ sppp_keepalive(void *dummy)
                SPPP_UNLOCK(sp);
        }
        splx(s);
-       callout_reset(&keepalive_ch, hz * LCP_KEEPALIVE_INTERVAL, sppp_keepalive, NULL);
+       callout_reset(&keepalive_ch, hz * SPPP_KEEPALIVE_INTERVAL, sppp_keepalive, NULL);
 
        SPPPQ_UNLOCK();
 }



Home | Main Index | Thread Index | Old Index