From owner-freebsd-current@FreeBSD.ORG Wed Feb 20 18:42:42 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 49C86B3D for ; Wed, 20 Feb 2013 18:42:42 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id 29282AED for ; Wed, 20 Feb 2013 18:42:42 +0000 (UTC) Received: from epsilon.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 9960B24EFD; Wed, 20 Feb 2013 10:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1361385757; bh=iW2jdW+QHj1pO7ttDOiskVYmNdbZcDxncnYg53x4YK4=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=uKprObrGVubI45vjFu564WvY2GBFo1pK8GUp56RYbc6Y6JRjwV8Atd9cpcCGMLw3W Ebuhmi5NhxK+eFiudDGt9+Bj25mEMC0jLlYTzSh2nhptJaqbxDw5BDTW3YDqd0us8+ RSjEF2OShYT9q35fwsL1v29sHSM03k0ujF6OKrBo= Message-ID: <5125191C.6010901@delphij.net> Date: Wed, 20 Feb 2013 10:42:36 -0800 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Sergey Kandaurov Subject: Re: [patch] remove negative socklen_t checks References: In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: FreeBSD Current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: d@delphij.net List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2013 18:42:42 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 02/20/13 09:19, Sergey Kandaurov wrote: > Hi. > > These checks are useless after the address length argument is > converted to socklen_t (up to SUSv2). Any objections? No objection in general but there is a minor style issue, see below. [...] > Index: sys/kern/uipc_syscalls.c > =================================================================== > > - --- sys/kern/uipc_syscalls.c (revision 246354) > +++ sys/kern/uipc_syscalls.c (working copy) @@ -353,8 +353,6 @@ > kern_accept(struct thread *td, int s, struct socka > > if (name) { *name = NULL; - if (*namelen < 0) - > return (EINVAL); } The { } for if () is no longer needed now per style(9). By the way I wonder why there is no compiler warning for this -- or do we compile kernel without signedness warnings? Just curious... Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- iQEcBAEBCgAGBQJRJRkcAAoJEG80Jeu8UPuzagkIAICE9uJzbLS8MvPPYLEMCop3 mamlq7AOJSpGfEyBzB0CZV2badJC91LEtUGADMN0CANPbvX6EpDsYoPygpXBuxei etNelbp1+9jbqwV6yK+9FVCioRiMMLrPKkyh02+s1ZhWCf6kjz3Xl9MEYKUKYuV1 ay7xLcLnQMxOzf1oS7Sovm6NsIFnDC06WZ0PZDFdBtv7typtGblw3rrgWMsOnshL x35C1UC8NgLnauMEOhX6Vr1zeRz+hqfw+YauCi/P+3chxfUgpe6XR551IN2h9xBU mYTNEjLkRgX8u5sCHYGB16r/OZ3X59w1sJH/21ayrHuF0gNEmQbnMlBnA/krH94= =iiGi -----END PGP SIGNATURE-----