[monitor_fdpass.c]
     Retry sendmsg/recvmsg on EAGAIN and EINTR; ok djm@
This commit is contained in:
Darren Tucker 2008-12-01 21:42:13 +11:00
parent 99d11a3ed2
commit 23645649bb
2 changed files with 13 additions and 4 deletions

View File

@ -8,6 +8,9 @@
packet_disconnect() on padding error, too. should reduce the success
probability for the CPNI-957037 Plaintext Recovery Attack to 2^-18
ok djm@
- dtucker@cvs.openbsd.org 2008/11/30 11:59:26
[monitor_fdpass.c]
Retry sendmsg/recvmsg on EAGAIN and EINTR; ok djm@
20081123
- (dtucker) [monitor_fdpass.c] Reduce diff vs OpenBSD by moving some
@ -4942,5 +4945,5 @@
OpenServer 6 and add osr5bigcrypt support so when someone migrates
passwords between UnixWare and OpenServer they will still work. OK dtucker@
$Id: ChangeLog,v 1.5146 2008/12/01 10:40:48 dtucker Exp $
$Id: ChangeLog,v 1.5147 2008/12/01 10:42:13 dtucker Exp $

View File

@ -1,4 +1,4 @@
/* $OpenBSD: monitor_fdpass.c,v 1.17 2008/03/24 16:11:07 deraadt Exp $ */
/* $OpenBSD: monitor_fdpass.c,v 1.18 2008/11/30 11:59:26 dtucker Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@ -75,7 +75,10 @@ mm_send_fd(int sock, int fd)
msg.msg_iov = &vec;
msg.msg_iovlen = 1;
if ((n = sendmsg(sock, &msg, 0)) == -1) {
while ((n = sendmsg(sock, &msg, 0)) == -1 && (errno == EAGAIN ||
errno == EINTR))
debug3("%s: sendmsg(%d): %s", __func__, fd, strerror(errno));
if (n == -1) {
error("%s: sendmsg(%d): %s", __func__, fd,
strerror(errno));
return -1;
@ -123,7 +126,10 @@ mm_receive_fd(int sock)
msg.msg_controllen = sizeof(cmsgbuf.buf);
#endif
if ((n = recvmsg(sock, &msg, 0)) == -1) {
while ((n = recvmsg(sock, &msg, 0)) == -1 && (errno == EAGAIN ||
errno == EINTR))
debug3("%s: recvmsg: %s", __func__, strerror(errno));
if (n == -1) {
error("%s: recvmsg: %s", __func__, strerror(errno));
return -1;
}