Commit 29c3e842 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

parasite: the type of the communication socket must be SOCK_SEQPACKET

We use unix socket to communicate with parasite. Before we used
SOCK_STREAM, but it doesn't guaranty that the message boundaries will be
save.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 229e4e50
...@@ -348,7 +348,7 @@ static int prepare_tsock(struct parasite_ctl *ctl, pid_t pid, ...@@ -348,7 +348,7 @@ static int prepare_tsock(struct parasite_ctl *ctl, pid_t pid,
return -1; return -1;
} }
ssock = socket(PF_UNIX, SOCK_STREAM, 0); ssock = socket(PF_UNIX, SOCK_SEQPACKET, 0);
if (ssock < 0) if (ssock < 0)
pr_perror("Can't create socket"); pr_perror("Can't create socket");
......
...@@ -499,7 +499,7 @@ static noinline __used int parasite_init_daemon(void *data) ...@@ -499,7 +499,7 @@ static noinline __used int parasite_init_daemon(void *data)
sigframe = args->sigframe; sigframe = args->sigframe;
tsock = sys_socket(PF_UNIX, SOCK_STREAM, 0); tsock = sys_socket(PF_UNIX, SOCK_SEQPACKET, 0);
if (tsock < 0) { if (tsock < 0) {
pr_err("Can't create socket: %d\n", tsock); pr_err("Can't create socket: %d\n", tsock);
goto err; goto err;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment