From owner-freebsd-current@FreeBSD.ORG Wed Oct 3 14:40:47 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8928716A417 for ; Wed, 3 Oct 2007 14:40:47 +0000 (UTC) (envelope-from coolaz@web.de) Received: from fmmailgate03.web.de (fmmailgate03.web.de [217.72.192.234]) by mx1.freebsd.org (Postfix) with ESMTP id 5A89613C44B for ; Wed, 3 Oct 2007 14:40:46 +0000 (UTC) (envelope-from coolaz@web.de) Received: from smtp08.web.de (fmsmtp08.dlan.cinetic.de [172.20.5.216]) by fmmailgate03.web.de (Postfix) with ESMTP id B123CA050C9A; Wed, 3 Oct 2007 16:13:50 +0200 (CEST) Received: from [91.16.234.82] (helo=example.net) by smtp08.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.108 #197) id 1Id4yz-0003x7-00; Wed, 03 Oct 2007 16:13:50 +0200 Received: by example.net (nbSMTP-1.00) for uid 1001 (using TLSv1/SSLv3 with cipher AES256-SHA (256/256 bits)) coolaz@web.de; Wed, 3 Oct 2007 16:14:13 +0200 (CEST) Date: Wed, 3 Oct 2007 16:14:12 +0200 From: Martin Kulas To: current@FreeBSD.org Message-ID: <20071003141412.GA1311@thunderbird.tld> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-PGP-Key: http://www.stud.uni-hamburg.de/~kulas/mkulas_pubkey.asc Sender: coolaz@web.de X-Sender: coolaz@web.de X-Provags-ID: V01U2FsdGVkX19ZQcVsNmfXG9zoB0Tdx5HYGssmnGXq+wBLflyw D7QorK24ngcC4/IQdvzQe5ZHEoI0uvGvnFEbtzPDy+A72jaAuj lqLwPNvYY= X-Mailman-Approved-At: Wed, 03 Oct 2007 17:12:44 +0000 Cc: Subject: [SCTP][patch] socket does not wake up X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Oct 2007 14:40:47 -0000 --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello! I patched netcat to support 1to1-SCTP sockets. Netcat uses the poll() system call to wait for new data in the socket buffer. The problem is that poll() does not return when the kernel has closed the SCTP association. Select() has the same problem. I digged around in the SCTP sources and created a patched to remove=20 that bug. The patch is a one-liner: --- sctp_pcb.c.orig 2007-10-03 13:27:12.000000000 +0200 +++ sctp_pcb.c 2007-10-03 15:51:55.286987000 +0200 @@ -4234,6 +4234,7 @@ SS_ISCONFIRMING | SS_ISCONNECTED); } + socantrcvmore(so); SOCK_UNLOCK(so); sctp_sowwakeup(inp, so); sctp_sorwakeup(inp, so); Now I have no problems with the system calls select()/poll() anymore. Is this patch OK or have I missed anything? Regards, Martin --=20 PGP Key: http://www.stud.uni-hamburg.de/~kulas/mkulas_pubkey.asc --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHA6Ozu1jKg1agQ1oRAqRBAJwN/1/0ou0WpmA4zpbL0zzrGuET2wCeIqF9 97WIYyaMgSqf1kXrI5On7rs= =VDLK -----END PGP SIGNATURE----- --uAKRQypu60I7Lcqm--