1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-30 16:51:41 +00:00
freebsd/sys
Ed Schouten 72c8072ee5 Make asynchronous connection failures on UNIX sockets fail with ECONNRESET.
While making CloudABI work well on Linux, I discovered that I had a
FreeBSD-ism in one of my unit tests. The test did the following:

- Create UNIX socket 1, bind it, make it listen.
- Create UNIX socket 2, connect it to UNIX socket 1.
- Close UNIX socket 1.
- Obtain SO_ERROR from socket 2.

On FreeBSD this returns ECONNABORTED, while on Linux it returns
ECONNRESET. I dug through some of the relevant specifications[1] and it
looks like Linux is all right here. ECONNABORTED should only be returned
when the local connection (socket 2) is aborted; not the peer (socket 1).

It is of course slightly misleading: the function in which we set this
error is called uipc_abort(), but keep in mind that we're aborting the
peer, thus resetting the local socket.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html

Reviewed by:	cem
Sponsored by:	Nuxi, the Netherlands
Differential Revision:	https://reviews.freebsd.org/D5419
2016-02-24 17:10:32 +00:00
..
amd64 Return dst as the result from memcpy(9) on amd64. 2016-02-24 11:58:15 +00:00
arm
arm64 Make pci_host_generic and thunderx_pci common 2016-02-24 06:05:30 +00:00
boot Add support for symmetric multiprocessing (SMP). 2016-02-24 16:50:34 +00:00
bsm
cam
cddl
compat Call cap_rights_init() properly. 2016-02-24 10:54:26 +00:00
conf Add support for symmetric multiprocessing (SMP). 2016-02-24 16:50:34 +00:00
contrib
crypto
ddb
dev hyperv/vmbus: Use free(9) for interrupt page; it is allocated by malloc(9) 2016-02-24 08:54:50 +00:00
fs
gdb
geom
gnu
i386
isa
kern Make asynchronous connection failures on UNIX sockets fail with ECONNRESET. 2016-02-24 17:10:32 +00:00
kgssapi
libkern
mips Migrate UNCOMPRESS -> UZIP 2016-02-24 03:06:26 +00:00
modules hyperv/utils: Code rearrange and cleanup 2016-02-24 05:01:18 +00:00
net
net80211
netgraph
netinet
netinet6
netipsec Fix useless check. m_pkthdr.len should be equal to orglen. 2016-02-24 12:28:49 +00:00
netnatm
netpfil Fix bug in filling and handling ipfw's O_DSCP opcode. 2016-02-24 13:16:03 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed
opencrypto
pc98
powerpc
riscv Add support for symmetric multiprocessing (SMP). 2016-02-24 16:50:34 +00:00
rpc
security
sparc64
sys Provide more correct sizing of the KVA consumed by a vnode, used by 2016-02-24 15:15:46 +00:00
teken
tests
tools
ufs
vm
x86
xdr
xen
Makefile