Module Name:    src
Committed By:   yamaguchi
Date:           Fri May 14 08:06:32 UTC 2021

Modified Files:
        src/sys/conf: files
        src/sys/net: if_spppsubr.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.1279 -r1.1280 src/sys/conf/files
cvs rdiff -u -r1.237 -r1.238 src/sys/net/if_spppsubr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1279 src/sys/conf/files:1.1280
--- src/sys/conf/files:1.1279	Sat Feb  6 16:03:31 2021
+++ src/sys/conf/files	Fri May 14 08:06:32 2021
@@ -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

Index: src/sys/net/if_spppsubr.c
diff -u src/sys/net/if_spppsubr.c:1.237 src/sys/net/if_spppsubr.c:1.238
--- src/sys/net/if_spppsubr.c:1.237	Tue May 11 06:42:42 2021
+++ src/sys/net/if_spppsubr.c	Fri May 14 08:06:32 2021
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: if_spppsubr.
 #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();
 }

Reply via email to