Subject: Re: rlogin connections closed with -current.
To: None <M.Drochner@fz-juelich.de>
From: Michael Graff <explorer@flame.org>
List: current-users
Date: 07/26/1999 17:26:49
Sorry to follow up my own post, but here's the bug.

Both INET and INET6 use TCP.  Both use the same fast and slow timeout
procedures.  Since the slow timeout was called twice (once for INET,
once for INET6) it was incrementing the idle counter by 2 each call,
or 4 times per second.  So, the code thought the socket was 2 hours
older than it should be when the timer first went off.

Here's a fix.  I've not committed it yet, since I'm not certain it is
the best one.

Index: in6_proto.c
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet6/in6_proto.c,v
retrieving revision 1.5
diff -u -r1.5 in6_proto.c
--- in6_proto.c	1999/07/22 03:59:42	1.5
+++ in6_proto.c	1999/07/27 00:26:21
@@ -173,7 +173,12 @@
 { SOCK_STREAM,	&inet6domain,	IPPROTO_TCP,	PR_CONNREQUIRED | PR_WANTRCVD | PR_LISTEN,
   tcp6_input,	0,		tcp6_ctlinput,	tcp_ctloutput,
   tcp_usrreq,
+#ifdef INET
+  /* If inet4, no need to have tcp_slowtimo and tcp_fasttimo happen TWICE */
+  tcp_init,	NULL,		NULL,		tcp_drain,	tcp_sysctl
+#else
   tcp_init,	tcp_fasttimo,	tcp_slowtimo,	tcp_drain,	tcp_sysctl
+#endif
 },
 #endif
 { SOCK_RAW,	&inet6domain,	IPPROTO_RAW,	PR_ATOMIC | PR_ADDR,