From 12c7430a01ad2b484987dd8ee24b6f2907e7366d Mon Sep 17 00:00:00 2001 From: Ian Gudger Date: Mon, 17 Dec 2018 17:52:05 -0800 Subject: Fix recv blocking for connectionless Unix sockets. Connectionless Unix sockets (DGRAM Unix sockets created with the socket system call) inherently only have a read queue. They do not establish bidirectional connections, instead, the connect system call only sets a default send location. Writes give the data to the other endpoint which has its own read queue. To simplify the code, connectionless Unix sockets still get read and write queues, but the write queue is a dummy and never waited on. The read queue is the connectionless endpoint's queue. This change fixes a bug where the dummy queue was incorrectly set as the read queue and the endpoint's queue was incorrectly set as the write queue. This meant that read notifications went to the dummy queue and were black holed. PiperOrigin-RevId: 225921042 Change-Id: I8d9059def787a2c3c305185b92d05093fbd2be2a --- test/syscalls/linux/socket_unix_blocking_local.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'test/syscalls') diff --git a/test/syscalls/linux/socket_unix_blocking_local.cc b/test/syscalls/linux/socket_unix_blocking_local.cc index f79e04b33..3c2105cc7 100644 --- a/test/syscalls/linux/socket_unix_blocking_local.cc +++ b/test/syscalls/linux/socket_unix_blocking_local.cc @@ -33,14 +33,12 @@ std::vector GetSocketPairs() { ApplyVec( FilesystemBoundUnixDomainSocketPair, AllBitwiseCombinations( - // FIXME: Add SOCK_DGRAM once blocking is fixed. - List{SOCK_STREAM, SOCK_SEQPACKET}, + List{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM}, List{0, SOCK_CLOEXEC})), ApplyVec( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations( - // FIXME: Add SOCK_DGRAM once blocking is fixed. - List{SOCK_STREAM, SOCK_SEQPACKET}, + List{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM}, List{0, SOCK_CLOEXEC}))); } -- cgit v1.2.3