summaryrefslogtreecommitdiff
path: root/src/lib/sockets.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-03-13 17:00:26 +0100
committerDimitri Staessens <dimitri.staessens@ugent.be>2018-03-13 17:08:52 +0100
commit7602d165397aae3fc83e3a7b1efe1c0df2044572 (patch)
tree288eed4f44aab63cd44663959d8a564d750b6209 /src/lib/sockets.c
parente03dedf0a4c40ceeb063f95777bc99628a980ec9 (diff)
downloadouroboros-7602d165397aae3fc83e3a7b1efe1c0df2044572.tar.gz
ouroboros-7602d165397aae3fc83e3a7b1efe1c0df2044572.zip
lib: Use sequenced datagrams with UNIX sockets
The UNIX sockets were using SOCK_STREAM, which does not preserve the message boundaries. This switches to SOCK_SEQPACKET. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Diffstat (limited to 'src/lib/sockets.c')
-rw-r--r--src/lib/sockets.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/sockets.c b/src/lib/sockets.c
index 9e5bbe17..6e7d4ad5 100644
--- a/src/lib/sockets.c
+++ b/src/lib/sockets.c
@@ -38,7 +38,7 @@ int client_socket_open(char * file_name)
int sockfd;
struct sockaddr_un serv_addr;
- sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
+ sockfd = socket(AF_UNIX, SOCK_SEQPACKET, 0);
if (sockfd < 0)
return -1;
@@ -66,7 +66,7 @@ int server_socket_open(char * file_name)
return -1;
}
- sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
+ sockfd = socket(AF_UNIX, SOCK_SEQPACKET, 0);
if (sockfd < 0)
return -1;