From owner-freebsd-hackers Fri Nov 1 12:49:58 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 87BA037B433 for ; Fri, 1 Nov 2002 12:49:57 -0800 (PST) Received: from MX1.wgate.com (mx1.wgate.com [66.150.46.4]) by mx1.FreeBSD.org (Postfix) with SMTP id A7ED943E75 for ; Fri, 1 Nov 2002 12:49:56 -0800 (PST) (envelope-from msinz@wgate.com) Received: FROM mail.tvol.net BY MX1.wgate.com ; Fri Nov 01 15:38:29 2002 -0500 Received: from sinz.eng.tvol.net ([10.32.2.99]) by mail.tvol.net with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 41A6M58N; Fri, 1 Nov 2002 15:44:14 -0500 Received: from wgate.com (localhost [127.0.0.1]) by sinz.eng.tvol.net (8.11.6/8.11.6) with ESMTP id gA1Ki5M59536; Fri, 1 Nov 2002 15:44:05 -0500 (EST) (envelope-from msinz@wgate.com) Message-ID: <3DC2E794.5060702@wgate.com> Date: Fri, 01 Nov 2002 15:44:04 -0500 From: Michael Sinz User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.1b) Gecko/20020813 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Matthew Dillon Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Socket so_linger setting References: <3DC27247.5040100@wgate.com> <200211012008.gA1K8rOa034485@apollo.backplane.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Matthew Dillon wrote: > I think your patch is fine as is, Mike! Good find! Even though > so_linger cannot be negative, it is often convenient to use a signed > integer to store the value to avoid unexpected arithmatic results > when mixing with signed operations. My quick perusal does not show > any cases of this for so_linger, so we could make it unsigned, but I > don't see any pressing need to do so. The range check would need > to be in there in either case. > > Can I go ahead and commit it? I would at least commit it as a range check... Maybe we should look at changing so_linger to unsigned too. (As I stated before, it "documents" the value range a bit more correctly and, with better compilers, the "math errors" would be warnings if you assumed signed-ness of the value :-) -- Michael Sinz -- Director, Systems Engineering -- Worldgate Communications A master's secrets are only as good as the master's ability to explain them to others. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message