From nobody@FreeBSD.org  Fri Aug 21 20:40:23 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3A37D1065672
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 21 Aug 2009 20:40:23 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 290838FC1A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 21 Aug 2009 20:40:23 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n7LKeMjv052324
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 21 Aug 2009 20:40:22 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n7LKeM7B052296;
	Fri, 21 Aug 2009 20:40:22 GMT
	(envelope-from nobody)
Message-Id: <200908212040.n7LKeM7B052296@www.freebsd.org>
Date: Fri, 21 Aug 2009 20:40:22 GMT
From: "H. Steuer" <steuer@patronas.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: tcp sockets stay in SYN_SENT even after receiving RST. never time out as well.
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         138046
>Category:       kern
>Synopsis:       [tcp] tcp sockets stay in SYN_SENT even after receiving RST. never time out as well.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    andre
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 21 20:50:04 UTC 2009
>Closed-Date:    
>Last-Modified:  Tue Aug 10 22:18:45 UTC 2010
>Originator:     H. Steuer
>Release:        7.1, 7.2, 8.0-BETA2 of august 2
>Organization:
>Environment:
FreeBSD xxxx 7.2-RELEASE-p3 FreeBSD 7.2-RELEASE-p3 #3: Tue Aug 18 22:50:46 CEST 2009     root@xxxxx:/usr/obj/usr/src/sys/DL380G5  i386

FreeBSD xxxxxx 7.1-RELEASE-p4 FreeBSD 7.1-RELEASE-p4 #1: Sat Apr 11 22:55:52 CEST 2009     root@xxxxx:/usr/obj/usr/src/sys/DL380G5  i386

FreeBSD edinburgh 8.0-BETA2 FreeBSD 8.0-BETA2 #1: Sun Aug  2 21:16:35 CEST 2009    pieter@edinburgh:/usr/obj/usr/src/sys/GENERIC-nodbg  i386


>Description:
when a tcp connection is made to a existing host but a non-listening port, the tcp connection will stay in state SYN_SENT and will never be closed unless the process gets killed.

tcpdump shows a SYN packet answered by a RST. so the RST should close the socket.
the second problem is that at least the socket should time out in some way which isnt the case either.

i have written a small tcp client that you can download at http://skywalker.patronas.de/tcpclient.c

it connects 50 times, so after running that app, you will see 50 sockets in SYN_ACK state.

>How-To-Repeat:
download http://skywalker.patronas.de/tcpclient.c
compile
run against exisiting host and non-listening port
while the process is alive, netstat -an | grep [port]
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Aug 24 04:08:39 UTC 2009 
Responsible-Changed-Why:  
This does not sound i386-specific. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138046 
Responsible-Changed-From-To: freebsd-net->andre 
Responsible-Changed-By: andre 
Responsible-Changed-When: Tue Aug 10 22:18:15 UTC 2010 
Responsible-Changed-Why:  
Take over. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138046 
>Unformatted:
