Date: Wed, 3 Oct 2007 16:14:12 +0200 From: Martin Kulas <coolaz@web.de> To: current@FreeBSD.org Subject: [SCTP][patch] socket does not wake up Message-ID: <20071003141412.GA1311@thunderbird.tld>
next in thread | raw e-mail | index | archive | help
--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: <patch> --- 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); </patch> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071003141412.GA1311>