summaryrefslogtreecommitdiffstats
path: root/lib/libnv/nvlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libnv/nvlist.c')
-rw-r--r--lib/libnv/nvlist.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libnv/nvlist.c b/lib/libnv/nvlist.c
index 323b2c8..299d60e 100644
--- a/lib/libnv/nvlist.c
+++ b/lib/libnv/nvlist.c
@@ -724,11 +724,11 @@ nvlist_recv(int sock)
{
struct nvlist_header nvlhdr;
nvlist_t *nvl, *ret;
+ unsigned char *buf;
size_t nfds, size;
- void *buf;
int serrno, *fds;
- if (msg_peek(sock, &nvlhdr, sizeof(nvlhdr)) == -1)
+ if (buf_recv(sock, &nvlhdr, sizeof(nvlhdr)) == -1)
return (NULL);
if (!nvlist_check_header(&nvlhdr))
@@ -741,10 +741,12 @@ nvlist_recv(int sock)
if (buf == NULL)
return (NULL);
+ memcpy(buf, &nvlhdr, sizeof(nvlhdr));
+
ret = NULL;
fds = NULL;
- if (buf_recv(sock, buf, size) == -1)
+ if (buf_recv(sock, buf + sizeof(nvlhdr), size - sizeof(nvlhdr)) == -1)
goto out;
if (nfds > 0) {
OpenPOWER on IntegriCloud