4.3BSD network bug (#9, tcp_output)
Index:	sys/netinet/tcp_output.c 4.3BSD FIX

Description:
TCP may scramble data at the end of a connection under conditions
of high packet loss.  If a connection is closed while output is still
draining (as FTP does), loss of more than one data segment in the last
window will cause a byte of data to be deleted without detection.

Fix:
*** /nbsd/sys/netinet/tcp_output.c	Wed Aug 20 09:31:34 1986
--- ./tcp_output.c	Sat Mar 28 15:32:04 1987
***************
*** 5,7 ****
   *
!  *	@(#)tcp_output.c	7.2 (Berkeley) 8/20/86
   */
--- 5,7 ----
   *
!  *	@(#)tcp_output.c	7.2.1.1 (Berkeley) 3/28/87
   */
***************
*** 232,235 ****
  	 */
! 	if (flags & TH_FIN && tp->t_flags & TF_SENTFIN &&
! 	    tp->snd_nxt != tp->snd_una)
  		tp->snd_nxt--;
--- 232,234 ----
  	 */
! 	if (flags & TH_FIN && tp->t_flags & TF_SENTFIN && len == 0)
  		tp->snd_nxt--;
