send() returns error even though data is sent, TCP connection still alive

Jeff Davis freebsd at
Wed Jan 31 21:40:09 UTC 2007

On Wed, 2007-01-31 at 15:04 -0500, Garrett Wollman wrote:
> In article <1170269163.22436.71.camel at dogma.v10.wvs>,
> Jeff Davis  <freebsd at> wrote:
> >You should see something like "write failed: host is down" and the
> >session will terminate. Of course, when ssh exits, the TCP connection
> >closes. The only way to see that it's still open and active is by
> >writing (or using) an application that ignores EHOSTDOWN errors from
> >write().
> I agree that it's a bug.  The only time write() on a stream socket
> should return the asynchronous error[1] is when the connection has
> been (or is in the process of being) torn down as a result of a
> subsequent timeout.  POSIX says "may fail" for these errors write()
> and send() on sockets

As far as I'm concerned, a fix for this bug is critical. We have had to
move production apps off some of our freebsd servers.

    Jeff Davis

More information about the freebsd-stable mailing list