Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Apr 2020 15:27:25 +0000 (UTC)
From:      "Jonathan T. Looney" <jtl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r359921 - head/sys/sys
Message-ID:  <202004141527.03EFRPMw055694@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jtl
Date: Tue Apr 14 15:27:24 2020
New Revision: 359921
URL: https://svnweb.freebsd.org/changeset/base/359921

Log:
  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

Modified:
  head/sys/sys/un.h

Modified: head/sys/sys/un.h
==============================================================================
--- head/sys/sys/un.h	Tue Apr 14 14:48:00 2020	(r359920)
+++ head/sys/sys/un.h	Tue Apr 14 15:27:24 2020	(r359921)
@@ -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



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