diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2017-04-03 19:42:05 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2017-04-03 19:42:05 +0000 |
commit | 2a18c7fd5d5f006405f1b816b94cb756cc608036 (patch) | |
tree | c0418d0797f4f0c640896a8f70d427b7a98151b9 /lib | |
parent | 8a49ee144a773180935ca993fc30fa63e028a515 (diff) |
Add caveat telling it's better to always read a data byte when passing
control messages.
Problem noted by Luke Small; ok deraadt@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/sys/recv.2 | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/libc/sys/recv.2 b/lib/libc/sys/recv.2 index 5f9c51fd7ef..7b312b2ba8d 100644 --- a/lib/libc/sys/recv.2 +++ b/lib/libc/sys/recv.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: recv.2,v 1.43 2015/02/16 16:20:15 tedu Exp $ +.\" $OpenBSD: recv.2,v 1.44 2017/04/03 19:42:04 otto Exp $ .\" $NetBSD: recv.2,v 1.6 1995/02/27 12:36:08 cgd Exp $ .\" .\" Copyright (c) 1983, 1990, 1991, 1993 @@ -30,7 +30,7 @@ .\" .\" @(#)recv.2 8.3 (Berkeley) 2/21/94 .\" -.Dd $Mdocdate: February 16 2015 $ +.Dd $Mdocdate: April 3 2017 $ .Dt RECV 2 .Os .Sh NAME @@ -364,3 +364,15 @@ The .Fn recv function call appeared in .Bx 4.2 . +.Sh CAVEATS +Calling +.Fn recvmsg +with a control message having no or an empty scatter/gather array +exposes variations in implementations. +To avoid these, always use an +.Fa iovec +with at least a one byte buffer and set +.Fa msg_iov +and an +.Fa msg_iovlen +to use this vector. |