[comp.bugs.2bsd] telnet bug on close followed by open

sms@wlv.imsd.contel.com (Steven M. Schultz) (08/01/90)

Subject: telnet bug on close followed by open (part 2)
Index:	ucb/telnet.c 2.10BSD

Description:
	Telnet can hang when doing a close followed by a open.

Repeat-By:
	telnet> toggle options
	telnet> open foobar
	telnet> close
	telnet> open foobar

	and telnet will hang.

Fix:

	The earlier fix which changed the return value of bye() is
	still needed, the problem was that patch only fixed part
	of the problem.  The rest of the solution is to clear
	the local telnet's option list.

*** telnet.c.old	Fri Jul 27 14:25:20 1990
--- telnet.c	Tue Jul 31 13:39:39 1990
***************
*** 1984,1989 ****
--- 1984,1991 ----
  		/* reset his options */
  		for (op = hisopts; op < &hisopts[256]; op++)
  			*op = 0;
+ 		/* reset our options */
+ 		bzero(myopts, 256);
  	}
  	return 0;
  }