From 80e72ee3ddf73119618277c05df724b01ffdf18a Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 13 May 2019 13:07:55 +0200 Subject: [esock|test] Add (stream) sendmsg and recvmsg test case for local Add a sendmsg and recvmsg test case for a unix domain (stream) socket. Found and fixed a bug for the return value for the address field for family 'local' (encoded as 'inet'). OTP-15822 --- erts/emulator/nifs/common/socket_nif.c | 2 +- erts/emulator/nifs/common/socket_util.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'erts/emulator/nifs/common') diff --git a/erts/emulator/nifs/common/socket_nif.c b/erts/emulator/nifs/common/socket_nif.c index 7484694cdb..d8203f3b91 100644 --- a/erts/emulator/nifs/common/socket_nif.c +++ b/erts/emulator/nifs/common/socket_nif.c @@ -15180,7 +15180,7 @@ char* encode_msghdr(ErlNifEnv* env, "\r\n read: %d" "\r\n", read) ); - /* The address is not used if we are connected, + /* The address is not used if we are connected (unless family is 'local'), * so check (length = 0) before we try to encodel */ if (msgHdrP->msg_namelen != 0) { diff --git a/erts/emulator/nifs/common/socket_util.c b/erts/emulator/nifs/common/socket_util.c index a61cfc75ef..4ba48afcfa 100644 --- a/erts/emulator/nifs/common/socket_util.c +++ b/erts/emulator/nifs/common/socket_util.c @@ -1656,7 +1656,7 @@ char* make_sockaddr_un(ErlNifEnv* env, ERL_NIF_TERM* sa) { ERL_NIF_TERM keys[] = {esock_atom_family, esock_atom_path}; - ERL_NIF_TERM vals[] = {esock_atom_inet, path}; + ERL_NIF_TERM vals[] = {esock_atom_local, path}; unsigned int numKeys = sizeof(keys) / sizeof(ERL_NIF_TERM); unsigned int numVals = sizeof(vals) / sizeof(ERL_NIF_TERM); -- cgit v1.2.3