Bug 96207 - Comments of a sockaddr_un structure could confuse one
Summary: Comments of a sockaddr_un structure could confuse one
Status: Open
Alias: None
Product: Documentation
Classification: Unclassified
Component: Documentation (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-doc (Nobody)
Depends on:
Reported: 2006-04-23 16:50 UTC by Rostislav Krasny
Modified: 2017-12-31 22:37 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Rostislav Krasny 2006-04-23 16:50:14 UTC
In RELENG_6 (and others) a sys/un.h has following definitions:

 * Definitions for UNIX IPC domain.
struct sockaddr_un {
        unsigned char   sun_len;        /* sockaddr len including null */
        sa_family_t     sun_family;     /* AF_UNIX */
        char    sun_path[104];          /* path name (gag) */

/* actual length of an initialized sockaddr_un */
#define SUN_LEN(su) \
        (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))

Comments of the sockaddr_un definition, together with the SUN_LEN(su)
definition, could confuse one. For example my first thought was that
there is a bug in the SUN_LEN(su) definition. About 9 years ago the
same confusion happened in the NetBSD project. Read a "SUN_LEN()
definition change" thread:


and commit logs of revisions 1.14 and 1.15:


Back to FreeBSD, I think the "/* sockaddr len including null */"
should be changed to "/* sockaddr_un len without NUL */"
and the "/* path name (gag) */" should be changed to
"/* NUL-terminated path name */". The unix(4) manual page already
gives the right information about that.


Already in the description
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:36 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped