From owner-cvs-all@FreeBSD.ORG Sun Jan 11 07:35:24 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0AA0516A4CE; Sun, 11 Jan 2004 07:35:24 -0800 (PST) Received: from gw.celabo.org (gw.celabo.org [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3EA2943D5D; Sun, 11 Jan 2004 07:35:21 -0800 (PST) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.celabo.org (Postfix) with ESMTP id D86545489C; Sun, 11 Jan 2004 09:35:20 -0600 (CST) Received: by madman.celabo.org (Postfix, from userid 1001) id 7F3176D45F; Sun, 11 Jan 2004 09:35:20 -0600 (CST) Date: Sun, 11 Jan 2004 09:35:20 -0600 From: "Jacques A. Vidrine" To: Don Lewis Message-ID: <20040111153520.GA89683@madman.celabo.org> References: <20040110152347.GD80448@madman.celabo.org> <200401102231.i0AMVg7E028954@gw.catspoiler.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200401102231.i0AMVg7E028954@gw.catspoiler.org> X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.4i-ja.1 cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern uipc_syscalls.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2004 15:35:24 -0000 On Sat, Jan 10, 2004 at 02:31:42PM -0800, Don Lewis wrote: > BTW, I think a better solution is for getsockaddr() to call an address > family specific length checker before returning, and to remove the > sa_len check from all the consumers. With the commit I did to the tcp > code after this commit, sa_len is checked three times for the bind() and > connect() syscalls. I wasn't feeling that ambitious, though. I agree, that's sounds like a good TODO item. > It looks like the AF_UNIX implementation allows the length to be shorter > than sizeof(*sa). It appears that you don't have to pass in the full > 104 character sun_path. That's correct. I believe that's not a well-defined area... I think some platforms actually require that sun_len == sizeof(struct sockaddr_un), while others do not. I seem to recall trying to put together a definitive answer based on Stevens' writings and available standards. I think at best one should use the SUN_LEN macro where availble, or else use the full size. (Sorry, drifting from the subject.) Cheers, -- Jacques Vidrine NTT/Verio SME FreeBSD UNIX Heimdal nectar@celabo.org jvidrine@verio.net nectar@freebsd.org nectar@kth.se