Date: Wed, 15 Jan 2003 02:20:12 +1100 (EST) From: Bruce Evans <bde@zeta.org.au> To: Martin Blapp <mb@imp.ch> Cc: Thomas Moestl <tmoestl@gmx.net>, <current@FreeBSD.ORG>, <net@FreeBSD.ORG> Subject: Re: PANIC in tcp_syncache.c sonewconn() line 562 Message-ID: <20030115020320.L17332-100000@gamplex.bde.org> In-Reply-To: <20030114100620.W76016@levais.imp.ch>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 14 Jan 2003, Martin Blapp wrote: > > Hi Thomas, > > > s = splnet(); > > + if (so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING)) { > > + splx(s); > > + return (EINVAL); > > + } > > error = (*so->so_proto->pr_usrreqs->pru_listen)(so, td); > > if (error) { > > splx(s); > > > > Can you commit this ? The fix looks appropriate, but the manpage should > also be changed to reflect the change. > > ERRORS > Listen() will fail if: > > [EBADF] The argument s is not a valid descriptor. > [ENOTSOCK] The argument s is not a socket. > [EOPNOTSUPP] The socket is not of a type that > supports the operation listen(). > [EINVAL] Listen() has been already called on the socket. > > Any objections from others ? EINVAL is a bogus errno for this, but is standard. POSIX has better wording: "The socket is already connected". The patch also returns EINVAL if the socket is being connected. Is this right? (Maybe we should wait until we can tell if it is connected.) POSIX also specifies the errors EDESTADDRREQ, EACCES, another EINVAL for shut down sockets, and ENOBUFS. The last 3 "may" cause listen() to fail and the others (including the first EINVAL) "shall" cause it to fail. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030115020320.L17332-100000>