Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Oct 2023 23:58:45 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 274226] No documentation for sendmsg/recvmsg ancilliary data.
Message-ID:  <bug-274226-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D274226

            Bug ID: 274226
           Summary: No documentation for sendmsg/recvmsg ancilliary data.
           Product: Documentation
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Manual Pages
          Assignee: bugs@FreeBSD.org
          Reporter: peterj@FreeBSD.org
                CC: doc@FreeBSD.org

recvmsg(2) and sendmsg(2) include provision for "ancillary data" via
msg_control and struct cmsghdr but there's no documentation on what cmsg_le=
vel
and cmsg_type mean or how to set them.  recvmsg(2) says "As an example, the
SO_TIMESTAMP socket option returns a reception timestamp for UDP packets" b=
ut
provides no information on how how to actually initialise the cmsghdr to do
that (the information is in getsockopt(2) but that isn't clear from the
recvmsg(2) man page).

In general, the recvmsg/sendmsg "ancillary data" manipulates similar data to
the setsockopt(2)/getsockopt(2) calls, but on a per-message basis, rather t=
han
a per-connection/socket basis.  Unfortunately, there's not an exact 1:1
relationship between the functions and in some cases, the data length varies
between the two paths - e.g. the only documentation for IP_TOS is in ip(4) =
and
indicates that it takes an int argument (4 bytes), but=20
https://cgit.freebsd.org/src/tree/sys/netinet/udp_usrreq.c#n1144 shows that
when used with sendmsg(2), the argument is a u_char (1 byte).

The direction is also unclear: getsockopt(2) and setsockopt(2) explicitly
indicate whether the data is being written to the socket or read from the
socket, whereas there's no such explicit indication for the msg_control pat=
h.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-274226-227>