diff options
author | 2007-10-29 18:36:00 +0000 | |
---|---|---|
committer | 2007-10-29 18:36:00 +0000 | |
commit | d27a6cb0d201a29cede718dca0ff0e446b1c8a62 (patch) | |
tree | 7d4174a7a5458cb299b0af2c3cb4a86a3e8f1783 | |
parent | Pull from master repo: (diff) | |
download | wireguard-openbsd-d27a6cb0d201a29cede718dca0ff0e446b1c8a62.tar.xz wireguard-openbsd-d27a6cb0d201a29cede718dca0ff0e446b1c8a62.zip |
For fd passing, at externalize time we are dealing with int[] not pointer[],
so we need to correct the mbuf length using CMSG_LEN() not CMSG_SPACE()
test case was sparc64 sending 2 (or more) descriptors
ok millert thib
-rw-r--r-- | sys/kern/uipc_usrreq.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 09097eea4be..e9fd18d44d6 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_usrreq.c,v 1.35 2007/09/07 15:00:20 art Exp $ */ +/* $OpenBSD: uipc_usrreq.c,v 1.36 2007/10/29 18:36:00 deraadt Exp $ */ /* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */ /* @@ -717,7 +717,7 @@ restart: */ memcpy(CMSG_DATA(cm), fdp, nfds * sizeof(int)); cm->cmsg_len = CMSG_LEN(nfds * sizeof(int)); - rights->m_len = CMSG_SPACE(nfds * sizeof(int)); + rights->m_len = CMSG_LEN(nfds * sizeof(int)); out: fdpunlock(p->p_fd); free(fdp, M_TEMP); |