IPv6 -> IPv4 fallback broken in serf, kernel bug?
Don Lewis
truckman at FreeBSD.org
Wed Jul 27 01:24:47 UTC 2016
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.
More information about the freebsd-net
mailing list