From owner-freebsd-doc@FreeBSD.ORG Sun Apr 23 15:50:16 2006 Return-Path: X-Original-To: freebsd-doc@hub.freebsd.org Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6520B16A403 for ; Sun, 23 Apr 2006 15:50:16 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 527B243D46 for ; Sun, 23 Apr 2006 15:50:15 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k3NFoFOR059364 for ; Sun, 23 Apr 2006 15:50:15 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k3NFoFnc059363; Sun, 23 Apr 2006 15:50:15 GMT (envelope-from gnats) Resent-Date: Sun, 23 Apr 2006 15:50:15 GMT Resent-Message-Id: <200604231550.k3NFoFnc059363@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Rostislav Krasny Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E0A2116A400 for ; Sun, 23 Apr 2006 15:41:45 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 94AA043D48 for ; Sun, 23 Apr 2006 15:41:45 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k3NFfj48080822 for ; Sun, 23 Apr 2006 15:41:45 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k3NFfjJ5080821; Sun, 23 Apr 2006 15:41:45 GMT (envelope-from nobody) Message-Id: <200604231541.k3NFfjJ5080821@www.freebsd.org> Date: Sun, 23 Apr 2006 15:41:45 GMT From: Rostislav Krasny To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: docs/96207: Comments of a sockaddr_un structure could confuse one X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Apr 2006 15:50:16 -0000 >Number: 96207 >Category: docs >Synopsis: Comments of a sockaddr_un structure could confuse one >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Sun Apr 23 15:50:14 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Rostislav Krasny >Release: 6.1-RC >Organization: >Environment: FreeBSD saturn.lan 6.1-RC FreeBSD 6.1-RC #0: Sun Apr 23 15:36:02 IDT 2006 root@saturn.lan:/usr/obj/usr/src/sys/MYKERNEL i386 >Description: 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: http://mail-index.netbsd.org/tech-kern/1997/02/ and commit logs of revisions 1.14 and 1.15: http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/un.h 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. >How-To-Repeat: >Fix: Already in the description >Release-Note: >Audit-Trail: >Unformatted: