Date: Mon, 28 Dec 2015 10:23:19 +1100 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Ian Lepore <ian@freebsd.org> Cc: NGie Cooper <yaneurabeya@gmail.com>, Slawa Olhovchenkov <slw@zxy.spb.ru>, Dmitry Chagin <dchagin@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292777 - in head: lib/libc/sys sys/kern Message-ID: <20151228093724.D1014@besplex.bde.org> In-Reply-To: <1451247868.1369.16.camel@freebsd.org> References: <201512271537.tBRFb7nN095297@repo.freebsd.org> <1451236237.1369.9.camel@freebsd.org> <20151227184101.GG70867@zxy.spb.ru> <1451243810.1369.10.camel@freebsd.org> <20151227193046.GE4535@zxy.spb.ru> <8D7D617E-FF9E-4D74-87CB-1F3EE65D108A@gmail.com> <1451247868.1369.16.camel@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 27 Dec 2015, Ian Lepore wrote: > On Sun, 2015-12-27 at 12:05 -0800, NGie Cooper wrote: >>> On Dec 27, 2015, at 11:30, Slawa Olhovchenkov <slw@zxy.spb.ru> >>> wrote: >> >> =85 >> >>>> I have no idea what you mean by that -- I didn't say anything at >>>> all >>>> about panic. >>> >>> As I understund commit log -- this is prevent kernel panic at some >>> call (with illegal arguments). This accpetable irrelevant to bugs >>> in >>> calling code. >> >> =09This also makes us POSIX compliant and more compatible with >> Linux: >> http://pubs.opengroup.org/onlinepubs/007908799/xsh/clock_settime.html >> (search for =93negative=94). >> Thanks kib! >> -NGie > > This thread just keeps becoming more and more surrealistic. First > someone tries to reply to the original commit (I guess?) by replying > with a complete non sequitur to my reply. Now you cite a document that > says nothing directly related to the commit at all. > > The only reference to "negative" in what you cited is part of > specifying how to truncate/round fractional values that fall between > two representable values given the resolution of the clock you're > setting. It also has an obfuscated verbose spelling of negative as "less than zero" in the description of [EINVAL]. This is the specification of a invalid timespec which is repeated ad nauseum. The upper limit is spelled even more verbosely as "greater than or equal to 1000 million". The correct spelling of this is ">=3D 1000000000" but that is hard to read in another way (too many 0's to count quickly). Spelling this value is remarkably difficult. There are about 10 different spellings that are no good since they depend on the locale or language (natural or programming). Mixing digits and words is ugly. 1 billion is shorter but is off by a factor of 1000 in some locales. I stared at this description many times. It doesn't allow considering negative times as invalid generally. setitimer(2) has to be specially broken to disallow them. This bug is missing for nanosleep(). FreeBSD still documents a non-POSIX limit of 100000000 seconds for setitimer(2), but its implementation has been broken to overflow instead of enforcing this limit. Note that this is 1 followed by 8 zeros and applies to the seconds value, while the limit for nanoseconds os 1 followed by 9 zeros. Different spellings of 1 followed by a large number of zeros makes thes value hard to grep for. 1 followed by 8 zeros is in about 50 man pages (counting links). It is documented as the limit on seconds in get/setitimer(2). mtree(8) misspells 1 followed by 9 zeros as 1 followed by 8 zeros. alarm(3) is implemented using itimers and documents the same limit. ularm(3) documents the bizarre limit of 1 followed by 14 zeros "in case this value fits in an the unsigned integer". This is alarm(3)'s documented but not actual limit of 10**8 seconds converted to microseconds. It is reachable on systems with >=3D 47 bit longs. This spelling is not used in any man page for the limit on the number of nanoseconds (as in POSIX). > Later in that document they specifically require EINVAL for negative > fractional second values. If they intended to to prohibit negative > whole-second values, that would certainly have been the place to > mention it, and they don't. This is the "obfuscated verbose spelling" part. This is not really a restriction on negative fractions. It is just that negative fractions are represented as a negative integer plus a proper fraction, where by definition a proper fraction is nonnegative and less than 1. Normalization gives this (except when it would overflow). The requirement is essentially that callers don't pass unnormalized values. Bruce From owner-svn-src-all@freebsd.org Sun Dec 27 23:25:22 2015 Return-Path: <owner-svn-src-all@freebsd.org> Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 761A3A5282E; Sun, 27 Dec 2015 23:25:22 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48EED1A87; Sun, 27 Dec 2015 23:25:22 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBRNPLPN041345; Sun, 27 Dec 2015 23:25:21 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBRNPLG3041344; Sun, 27 Dec 2015 23:25:21 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201512272325.tBRNPLG3041344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert <cy@FreeBSD.org> Date: Sun, 27 Dec 2015 23:25:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292811 - stable/10/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" <svn-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>, <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/> List-Post: <mailto:svn-src-all@freebsd.org> List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>, <mailto:svn-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 27 Dec 2015 23:25:22 -0000 Author: cy Date: Sun Dec 27 23:25:21 2015 New Revision: 292811 URL: https://svnweb.freebsd.org/changeset/base/292811 Log: MFC r292518. Don't assume checksums will be calculated later when fastfoward is enabled (by default in r290383). PR: 72210 Modified: stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Sun Dec 27 23:04:12 2015 (r292810) +++ stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Sun Dec 27 23:25:21 2015 (r292811) @@ -5123,7 +5123,7 @@ ipf_nat_out(fin, nat, natadd, nflags) ipf_fix_outcksum(0, &fin->fin_ip->ip_sum, msumd, 0); } #if !defined(_KERNEL) || defined(MENTAT) || defined(__sgi) || \ - defined(linux) || defined(BRIDGE_IPF) + defined(linux) || defined(BRIDGE_IPF) || defined(__FreeBSD__) else { /* * Strictly speaking, this isn't necessary on BSD @@ -5235,7 +5235,7 @@ ipf_nat_out(fin, nat, natadd, nflags) uh->uh_ulen += fin->fin_plen; uh->uh_ulen = htons(uh->uh_ulen); #if !defined(_KERNEL) || defined(MENTAT) || defined(__sgi) || \ - defined(linux) || defined(BRIDGE_IPF) + defined(linux) || defined(BRIDGE_IPF) || defined(__FreeBSD) ipf_fix_outcksum(0, &ip->ip_sum, sumd, 0); #endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20151228093724.D1014>