diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-01-09 20:15:15 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-01-10 11:29:16 +0100 |
commit | 2edbe4d366fcc9c340093d6daedcb08b1f62911f (patch) | |
tree | 668d4336c5e77d4af776ea9fe474cb089ded190d | |
parent | a3694bd3033a683e768d43ec740f667d50acf8d3 (diff) |
Sockets.cpp: Fix initialization of UDD socket
Without this line, destination address for a UDD socket is left with
incorrect value AF_UNSPEC. Later on when calling DatagramSocket:write(),
sendto() fails with EINVAL.
This commit fixes test SocketsTest.cpp.
Change-Id: I6e1b7e743a781abdcf69aa9842b30be893633433
-rw-r--r-- | CommonLibs/Sockets.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/CommonLibs/Sockets.cpp b/CommonLibs/Sockets.cpp index a65d62b..11e96dd 100644 --- a/CommonLibs/Sockets.cpp +++ b/CommonLibs/Sockets.cpp @@ -324,6 +324,7 @@ void UDDSocket::open(const char* localPath) void UDDSocket::destination(const char* remotePath) { struct sockaddr_un* unAddr = (struct sockaddr_un*)mDestination; + unAddr->sun_family = AF_UNIX; strcpy(unAddr->sun_path,remotePath); } |