aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan T. Looney <jtl@FreeBSD.org>2020-04-14 15:27:24 +0000
committerJonathan T. Looney <jtl@FreeBSD.org>2020-04-14 15:27:24 +0000
commita5d22a7fedd23d816e7a1573133509f4dc681d71 (patch)
tree5872678c7b711e0b8468b508dc6771f32901d480 /sys
parent4d77243c652bb43b164985eba602abaf51d487c3 (diff)
downloadsrc-a5d22a7fedd23d816e7a1573133509f4dc681d71.tar.gz
src-a5d22a7fedd23d816e7a1573133509f4dc681d71.zip
Make the path length of UNIX domain sockets specified by a #define.
Also, add a comment describing the historical context for this length. Reviewed by: bz, jhb, kbowling (previous version) MFC after: 2 weeks Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D24272
Notes
Notes: svn path=/head/; revision=359921
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/un.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/sys/un.h b/sys/sys/un.h
index f83652e07de1..3c408628ce0a 100644
--- a/sys/sys/un.h
+++ b/sys/sys/un.h
@@ -44,12 +44,20 @@ typedef __sa_family_t sa_family_t;
#endif
/*
+ * Historically, (struct sockaddr) needed to fit inside an mbuf.
+ * For this reason, UNIX domain sockets were therefore limited to
+ * 104 bytes. While this limit is no longer necessary, it is kept for
+ * binary compatibility reasons.
+ */
+#define SUNPATHLEN 104
+
+/*
* 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) */
+ char sun_path[SUNPATHLEN]; /* path name (gag) */
};
#if __BSD_VISIBLE