From owner-freebsd-net Mon Apr 29 2: 7: 5 2002 Delivered-To: freebsd-net@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id 44CE237B400 for ; Mon, 29 Apr 2002 02:06:59 -0700 (PDT) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 29 Apr 2002 10:06:58 +0100 (BST) To: Terry Lambert Cc: net@freebsd.org Subject: Re: soisdisconnected tweak. In-reply-to: Your message of "Sun, 28 Apr 2002 18:07:51 PDT." <3CCC9CE7.B838EA8C@mindspring.com> X-Request-Do: Date: Mon, 29 Apr 2002 10:06:56 +0100 From: David Malone Message-ID: <200204291006.aa93819@salmon.maths.tcd.ie> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > A shutdown guarantees that the data is transferred from the socket > buf to the TCP buf. The real question here is how you get to the > state you claim is happening: the so isdisconnected() should stall > the calling process until the data has drained, if this is the case, > or it should never get called until the buffer is empty. I think your fears about data being lost here may be unfounded. The description of soisdisconnected() says: ... soisdisconnected() is called when the connection to the peer is totally severed. This seems to mean that that either the connection has timed out or has been aborted. I think it should be safe to drop any data which is waiting to be sent if connection is actually severed. I've included a list of the places where soisdisconnected is called from, and they all seem pretty final. David. unp_detach unp_disconnect raw_uabort raw_udisconnect ddp_disconnect ddp_abort at_pcbdetach atm_sock_connect (if connect fails) ngs_rmnode div_abort rip_abort tcp_input (TCPS_FIN_WAIT_1 && ourfinisacked) || (TCPS_CLOSING && ourfinisacked) || (TCPS_FIN_WAIT_2 && FIN) tcp_close tcp_usrclosed (and we're in state >= TCPS_FIN_WAIT_2) udp_abort rip6_abort udp6_abort ipx_abort ipx_drop ipx_usr_abort ipx_disconnect spx_close natm_usr_disconnect natm_usrreq for PRU_DISCONNECT idp_abort idp_drop idp_usrreq for PRU_DISCONNECT and PRU_ABORT spp_close To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message