Date: Fri, 01 Nov 2002 15:44:04 -0500 From: Michael Sinz <msinz@wgate.com> To: Matthew Dillon <dillon@apollo.backplane.com> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Socket so_linger setting Message-ID: <3DC2E794.5060702@wgate.com> References: <3DC27247.5040100@wgate.com> <200211012008.gA1K8rOa034485@apollo.backplane.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3DC2E794.5060702>