From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7492 invoked by alias); 30 Apr 2013 19:40:52 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 7481 invoked by uid 89); 30 Apr 2013 19:40:52 -0000 X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from plane.gmane.org (HELO plane.gmane.org) (80.91.229.3) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 30 Apr 2013 19:40:51 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UXGPK-0004Hx-Ls for ecos-discuss@ecos.sourceware.org; Tue, 30 Apr 2013 21:40:10 +0200 Received: from dsl.comtrol.com ([64.122.56.22]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Apr 2013 21:40:10 +0200 Received: from grant.b.edwards by dsl.comtrol.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Apr 2013 21:40:10 +0200 To: ecos-discuss@ecos.sourceware.org From: Grant Edwards Date: Tue, 30 Apr 2013 19:40:00 -0000 Message-ID: References: User-Agent: slrn/1.0.1 (Linux) Subject: [ECOS] Re: BSD TCP connect() ignores SO_REUSEADDR option X-SW-Source: 2013-04/txt/msg00037.txt.bz2 On 2013-04-30, Grant Edwards wrote: > I've recently noticed that when using the FreeBSD TCP stack, the > connect() system call ignores the SO_REUSEADDRESS setting and returns > EADDRINUSE when attempting to connect a TCP socket if a connection > with the same (SrcIP,SrcPort,DstIP,DstPort) tuple is still hanging > around in the TIME_WAIT state. It appears that the work-around for this is to set the SO_LINGER option with a timeout of 0 before calling close(). That reportedly sends a RST instead of a FIN, and the socket doesn't hang around in the TIME_WAIT state... -- Grant Edwards grant.b.edwards Yow! Thousands of days of at civilians ... have produced gmail.com a ... feeling for the aesthetic modules -- -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss