NetBSD Problem Report #3733

Received: (qmail 17924 invoked from network); 10 Jun 1997 08:33:52 -0000
Message-Id: <199706100847.KAA12850@i41am1.ira.uka.de>
Date: Tue, 10 Jun 1997 10:47:04 +0200 (MET DST)
From: frueauf@ira.uka.de
Reply-To: frueauf@ira.uka.de
To: gnats-bugs@gnats.netbsd.org
Subject: 2 bugs in tcp_input.c mentioned in "TCP/IP Illustrated Vol 2"
X-Send-Pr-Version: 3.95

>Number:         3733
>Category:       kern
>Synopsis:       2 bugs in tcp_input.c mentioned in "TCP/IP Illustrated Vol 2"
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 10 01:35:01 +0000 1997
>Closed-Date:    Fri May 05 14:54:04 +0000 2000
>Last-Modified:  Fri May 05 14:54:04 +0000 2000
>Originator:     Thorsten Frueauf
>Release:        NetBSD current 08.06.1997
>Organization:
private

>Environment:

System: NetBSD cyberlap 1.2F NetBSD 1.2F (CYBERLAP) #4: Tue Jun 10 07:46:20 CEST 1997 frueauf@cyberlap:/usr/src/sys/arch/i386/compile/CYBERLAP i386

>Description:

There are 2 bugs in /src/sys/netinet/tcp_input.c described in
"TCP/IP Illustrated Vol. 2" which I think are stil in NetBSD too:

1) According to page 948, the timer should be turned off only if the ACK flag
   is set, since the receipt of a SYN without an ACK is a simultaneous open,
   and doesn't mean the other end received TCP's SYN.

2) The bug mentioned on page 956 is explained and solved in more
   detail on page 959ff. - NetBSD has one part of the fix, but
   there is stil one part missing.

>How-To-Repeat:

Read the above cited pages in "TCP/IP Illustrated Vol. 2".

>Fix:

the following patch worked for me without problems yet. Apply it to
/src/sys/netinet/tcp_input.c:

*** tcp_input.c-orig	Mon Jun  9 23:41:45 1997
--- tcp_input.c	Tue Jun 10 00:13:50 1997
***************
*** 658,665 ****
  			tp->snd_una = ti->ti_ack;
  			if (SEQ_LT(tp->snd_nxt, tp->snd_una))
  				tp->snd_nxt = tp->snd_una;
  		}
- 		tp->t_timer[TCPT_REXMT] = 0;
  		tp->irs = ti->ti_seq;
  		tcp_rcvseqinit(tp);
  		tp->t_flags |= TF_ACKNOW;
--- 658,665 ----
  			tp->snd_una = ti->ti_ack;
  			if (SEQ_LT(tp->snd_nxt, tp->snd_una))
  				tp->snd_nxt = tp->snd_una;
+ 			tp->t_timer[TCPT_REXMT] = 0;
  		}
  		tp->irs = ti->ti_seq;
  		tcp_rcvseqinit(tp);
  		tp->t_flags |= TF_ACKNOW;
***************
*** 753,759 ****
  			}
  			todrop--;
  		}
! 		if (todrop >= ti->ti_len) {
  			/*
  			 * Any valid FIN must be to the left of the
  			 * window.  At this point, FIN must be a
--- 753,761 ----
  			}
  			todrop--;
  		}
! 		if (todrop >= ti->ti_len ||
! 		    (todrop == ti->ti_len && (tiflags & TH_FIN) == 0)) {
! 
  			/*
  			 * Any valid FIN must be to the left of the
  			 * window.  At this point, FIN must be a
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->kleink 
Responsible-Changed-By: kleink 
Responsible-Changed-When: Tue Jul 8 03:21:26 PDT 1997 
Responsible-Changed-Why:  
I'm going to take care of this. 
Responsible-Changed-From-To: kleink->kern-bug-people 
Responsible-Changed-By: kleink 
Responsible-Changed-When: Mon Feb 16 03:55:36 PST 1998 
Responsible-Changed-Why:  
I haven't received any positive or negative response from the people I've 
asked to review this. 
State-Changed-From-To: open->closed 
State-Changed-By: matt 
State-Changed-When: Fri May 5 07:52:11 PDT 2000 
State-Changed-Why:  
Both fixes are now present in tcp_input.c 
>Unformatted:
 2 bugs in tcp_input.c mentioned in "TCP/IP Illustrated Vol 2"

 matt: Both fixes are now present in tcp_input.c

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.