[PATCH] Add a Maximum Idle Time (1.2.2)

Jacob Luna Lundberg jacob at velius.chaos2.org
Mon Mar 6 20:08:59 EST 2000


Marc Haber <openssh-unix-dev.mindrot.org at marc-haber.de> wrote:
> Then my problem is somewhere else since my client is TeraTerm ssh on a
> Windows box.

     I presume that the server is a Linux box?  If you can get root on the
box that houses the server, try changing _its_ keepalive timeout to 300
seconds.  That might do it for you.

     The serverloop itself is a bit more complex conceptually than the
clientloop and already implements a timeout in order to collate small
transmissions into larger ones.  The attached patch should be categorized
under "Garish Malformed Hackish Patchlets" and is not really implemented
right but could give a general idea of where you'd have to work to
implement ignore packets in the serverloop.

-Jacob

-- 

"Heh.  You mean this is Stef's source code?"
  -User Friendly

-------------- next part --------------
--- openssh-1.2.2/serverloop.c	Mon Jan 17 01:55:19 2000
+++ openssh-1.2.2-trans_inter-r1/serverloop.c	Mon Mar  6 01:01:35 2000
@@ -290,15 +290,18 @@
 			max_time_milliseconds = 100;
 
 	if (max_time_milliseconds == 0)
-		tvp = NULL;
+		tv.tv_sec = 300;
 	else {
 		tv.tv_sec = max_time_milliseconds / 1000;
 		tv.tv_usec = 1000 * (max_time_milliseconds % 1000);
-		tvp = &tv;
 	}
+	tvp = &tv;
 
 	/* Wait for something to happen, or the timeout to expire. */
 	ret = select(max_fd + 1, readset, writeset, NULL, tvp);
+	packet_start(SSH_MSG_IGNORE);
+	packet_put_string("JunkPacket", 10);
+	packet_send();
 
 	if (ret < 0) {
 		if (errno != EINTR)


More information about the openssh-unix-dev mailing list