Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jul 2016 18:24:38 -0700 (PDT)
From:      Don Lewis <truckman@FreeBSD.org>
To:        brde@optusnet.com.au
Cc:        freebsd-net@freebsd.org
Subject:   Re: IPv6 -> IPv4 fallback broken in serf, kernel bug?
Message-ID:  <201607270124.u6R1OcTi082647@gw.catspoiler.org>
In-Reply-To: <201607262340.u6QNes2t082436@gw.catspoiler.org>

next in thread | previous in thread | raw e-mail | index | archive | help
After giving this some more thought, I believe that the read and write
wakeups are correct when the connection attempt fails.  I also think
that read() should return ENOTCONN if the socket never got to the
connected state.

I'm not sure how write() should behave.  The Open Group Base
Specifications Issue 7 says:

[ECONNRESET]
    A write was attempted on a socket that is not connected.

[EPIPE]
    A write was attempted on a socket that is shut down for writing, or
    is no longer connected. In the latter case, if the socket is of type
    SOCK_STREAM, a SIGPIPE signal shall also be sent to the thread.

whereas our man page only mentions EPIPE.

I think poll() should set POLLERR and not POLLIN or POLLOUT if the
connection attempt fails.

I think kqueue is fine, but the poll() emulation in apr should map the
connection failure into POLLERR.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607270124.u6R1OcTi082647>