diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-03-24 16:11:09 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-03-24 16:11:09 +0000 |
commit | 0bdf18c9edb2e6a9fa89a28e89d11e7b6785b1fd (patch) | |
tree | bd0dc86a525e38150bde9f0c3d55ad9dfeb4e6a2 /usr.sbin/rtadvd/rtadvd.c | |
parent | 6e48c70f167662c7aec42af9bafc316e322ef92a (diff) |
msg_controllen has to be CMSG_SPACE so that the kernel can account for
each cmsg_len (ie. msg_controllen = sum of CMSG_ALIGN(cmsg_len). This
works now that kernel fd passing has been fixed to accept a bit of
sloppiness because of this ABI repair.
lots of discussion with kettenis
Diffstat (limited to 'usr.sbin/rtadvd/rtadvd.c')
-rw-r--r-- | usr.sbin/rtadvd/rtadvd.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c index 1738f3e662b..fa597f56df4 100644 --- a/usr.sbin/rtadvd/rtadvd.c +++ b/usr.sbin/rtadvd/rtadvd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtadvd.c,v 1.29 2008/03/18 19:32:18 deraadt Exp $ */ +/* $OpenBSD: rtadvd.c,v 1.30 2008/03/24 16:11:05 deraadt Exp $ */ /* $KAME: rtadvd.c,v 1.66 2002/05/29 14:18:36 itojun Exp $ */ /* @@ -67,10 +67,8 @@ struct msghdr rcvmhdr; static u_char *rcvcmsgbuf; -static size_t rcvcmsgbufspace; static size_t rcvcmsgbuflen; static u_char *sndcmsgbuf = NULL; -static size_t sndcmsgbufspace; static size_t sndcmsgbuflen; volatile sig_atomic_t do_dump; volatile sig_atomic_t do_die; @@ -1297,20 +1295,16 @@ sock_open() static u_char answer[1500]; rcvcmsgbuflen = CMSG_SPACE(sizeof(struct in6_pktinfo)) + - CMSG_LEN(sizeof(int)); - rcvcmsgbufspace = CMSG_SPACE(sizeof(struct in6_pktinfo)) + CMSG_SPACE(sizeof(int)); - rcvcmsgbuf = (u_char *)malloc(rcvcmsgbufspace); + rcvcmsgbuf = (u_char *)malloc(rcvcmsgbuflen); if (rcvcmsgbuf == NULL) { syslog(LOG_ERR, "<%s> not enough core", __func__); exit(1); } sndcmsgbuflen = CMSG_SPACE(sizeof(struct in6_pktinfo)) + - CMSG_LEN(sizeof(int)); - sndcmsgbufspace = CMSG_SPACE(sizeof(struct in6_pktinfo)) + CMSG_SPACE(sizeof(int)); - sndcmsgbuf = (u_char *)malloc(sndcmsgbufspace); + sndcmsgbuf = (u_char *)malloc(sndcmsgbuflen); if (sndcmsgbuf == NULL) { syslog(LOG_ERR, "<%s> not enough core", __func__); exit(1); |