diff options
author | 2006-10-23 07:13:56 +0000 | |
---|---|---|
committer | 2006-10-23 07:13:56 +0000 | |
commit | 5fc0dcafe1260522cd4f6231dbc9c6e33eeb05b9 (patch) | |
tree | 4011bf017784527de09e078c2c189d1db91cde2c | |
parent | no need to use "keep state" and "flags S/SA" in pf rules, (diff) | |
download | wireguard-openbsd-5fc0dcafe1260522cd4f6231dbc9c6e33eeb05b9.tar.xz wireguard-openbsd-5fc0dcafe1260522cd4f6231dbc9c6e33eeb05b9.zip |
fix control message length check, needs CMSG_ALIGN()
reported by ryo@nerv.org to netbsd, noticed by miod, ok millert
-rw-r--r-- | sys/kern/uipc_syscalls.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index bd8c22a50cb..3627d7c4ce3 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_syscalls.c,v 1.65 2006/10/21 02:18:00 tedu Exp $ */ +/* $OpenBSD: uipc_syscalls.c,v 1.66 2006/10/23 07:13:56 henning Exp $ */ /* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */ /* @@ -482,7 +482,7 @@ sendit(struct proc *p, int s, struct msghdr *mp, int flags, register_t *retsize) goto bad; } if (mp->msg_control) { - if (mp->msg_controllen < sizeof(struct cmsghdr) + if (mp->msg_controllen < CMSG_ALIGN(sizeof(struct cmsghdr)) #ifdef COMPAT_OLDSOCK && mp->msg_flags != MSG_COMPAT #endif |