From owner-svn-src-head@freebsd.org Fri Apr 21 03:16:50 2017 Return-Path: Delivered-To: svn-src-head@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 04ABED490B2; Fri, 21 Apr 2017 03:16:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id C21241E97; Fri, 21 Apr 2017 03:16:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 783D11A38A1; Fri, 21 Apr 2017 13:16:40 +1000 (AEST) Date: Fri, 21 Apr 2017 13:16:44 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Cy Schubert cc: Michael Tuexen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317208 - head/sys/netinet In-Reply-To: <201704210143.v3L1h99s037727@slippy.cwsent.com> Message-ID: <20170421131041.G966@besplex.bde.org> References: <201704210143.v3L1h99s037727@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=JOBH9iDo1MMysTRtogwA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Apr 2017 03:16:50 -0000 On Thu, 20 Apr 2017, Cy Schubert wrote: Please trim quotes. > In message <201704201919.v3KJJYko052651@repo.freebsd.org>, Michael Tuexen > write > s: [>> ... 5 lines trimmed] >> Log: >> Syncoockies can be used in combination with the syncache. If the cache >> overflows, syncookies are used. [>> ... 16 lines trimmed] >> Modified: head/sys/netinet/tcp_syncache.c >> ============================================================================= >> = >> --- head/sys/netinet/tcp_syncache.c Thu Apr 20 19:14:52 2017 (r31720 >> 7) >> +++ head/sys/netinet/tcp_syncache.c Thu Apr 20 19:19:33 2017 (r31720 >> 8) >> @@ -260,6 +260,7 @@ syncache_init(void) >> &V_tcp_syncache.hashbase[i].sch_mtx, 0); >> V_tcp_syncache.hashbase[i].sch_length = 0; >> V_tcp_syncache.hashbase[i].sch_sc = &V_tcp_syncache; >> + V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN; > ... > This line produced the following on i386: > > /opt/src/svn-current/sys/netinet/tcp_syncache.c:263:50: error: implicit > conversion from 'long long' to 'time_t' (aka 'int') changes value from > -9223372036854775808 to 0 [-Werror,-Wconstant-conversion] > V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN; > ~ ^~~~~~~~~ > ./x86/_stdint.h:91:41: note: expanded from macro 'INT64_MIN' > #define INT64_MIN (-0x7fffffffffffffffLL-1) > ~~~~~~~~~~~~~~~~~~~~~^~ > > Looks like it needs a time_t cast. A cast would just break the warning. INT64_MIN has nothing to do with time_t. The expression (time_t)INT64_MIN would be more obviously garbage since in the above it is not clear that sch_last_overflow has a type unrelated to the constant. INT64_MIN is also broken if time_t is 64 bits but unsigned. Then it is converted to half of plus infinity instead of the intended minus infinity. Bruce