From owner-svn-src-all@freebsd.org Tue Sep 10 14:03:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A4B8D7544 for ; Tue, 10 Sep 2019 14:03:36 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46SRZv5Q3Mz4TSv for ; Tue, 10 Sep 2019 14:03:35 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1568124214; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Y6QYn/XVBRWGMh315ITuQQBO46sei/QBVtUgIhQQ7HWhbiDo63fQpr9PzXxt6HTtmwAdtZalW+nBt BJT0euN4LGhVkaDQNhzMR7XSWmnE0IqaXfPZDxiNxKq/abDmJk8DCMtS6ycSbhW7uJhjQ+/kx/j2au Fw7PUl7F4H4Nu3UttM/v5lr3viYTgbgSUtmx3akNbCf0ukWBW0x5Y6dHwWhpQgUo3TQr8ISbPYqZ6C EWUogl5k5tAfCzaOXSd2ZnK9FrdPOWzpdIBtSKPJCWfeK5d59jN6HCg7oSxAQleWv+YN9RT8B6obZT rcp/Q4j7PgmZQ99LB3uqoGgKZv49fUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=barJODCK+NNID+q5G8FigBGpZvZ1I7zNyMchL9WKpyg=; b=rwixgx3sAhvDMlsPT4cUQaRgev/0ZE+vLKt/V1qp11irDc/4e/uQP9LpNjFEOxiJJo1tbYDeyCWuN /oYX8Da125uUrNvcPiXDiz0BjSRM9raYg35b4GdDtv8l13F8VQGaTuf3QVSWDhG6nNajsaQ79Up71f /xIr3EKaPFCCs0eQXzOz5FYgBBc956CVJSNU5btVIavjpyQkU3PjwdSiPOcbQBtxiDX0lqAIahYnQf C54QwiRB/nWIMhhDnnuhquU3CxgsnbU/q3OonL9iRr+m7Le8h9zxX95XS2fix5h+KAK3Q1Vh7usY0i xIaoctUfxD/4w8+/S1U58imhgdMVORA== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=barJODCK+NNID+q5G8FigBGpZvZ1I7zNyMchL9WKpyg=; b=H/FbNQ7JTcSKz5Lhkb6o+jxpXFjqb2CXrCIh1pJnl6pRmpuvd1ENyQ2GHHvKRTGHAbnwdA4Hylt2h 6S2NggE3EFJ6ecYBA3LuBvh6ZuliIL23xAx2CwA2klbtIqAtPMTl0jgewEQ6nskkuLC7bubUbVg5Jc TNzECDBmpVJRh3YDG8ANEwlT+mVlYfNEnyr8whF6UNjJFS2SmgHhG7/+7AGLy/GFXENMZzO/5AYXcx tOekQ6Yih8lFO8690PefPptAv4adiJQG/uuxk8swWpAp9cnBP2mltvljMC81y+uzDYtKtL1SO0Xiyg bZ0U71InbfUl5FDodKqaiYygrqLuF1g== X-MHO-RoutePath: aGlwcGll X-MHO-User: c4202099-d3d3-11e9-b67d-cdd75d6ce7a8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id c4202099-d3d3-11e9-b67d-cdd75d6ce7a8; Tue, 10 Sep 2019 14:03:30 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x8AE3Tr0066775; Tue, 10 Sep 2019 08:03:29 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <06266e49ff64bba81b435c58985db7d88c74be03.camel@freebsd.org> Subject: Re: svn commit: r352113 - head/sys/net From: Ian Lepore To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 10 Sep 2019 08:03:29 -0600 In-Reply-To: <201909100156.x8A1ulJx087903@repo.freebsd.org> References: <201909100156.x8A1ulJx087903@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46SRZv5Q3Mz4TSv X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 14:03:36 -0000 On Tue, 2019-09-10 at 01:56 +0000, Conrad Meyer wrote: > Author: cem > Date: Tue Sep 10 01:56:47 2019 > New Revision: 352113 > URL: https://svnweb.freebsd.org/changeset/base/352113 > > Log: > Appease Clang false-positive Werrors in r352112 > > Reported by: bcran > > Modified: > head/sys/net/rtsock.c > > Modified: head/sys/net/rtsock.c > ===================================================================== > ========= > --- head/sys/net/rtsock.c Mon Sep 9 22:54:27 2019 (r352112) > +++ head/sys/net/rtsock.c Tue Sep 10 01:56:47 2019 (r352113) > @@ -2105,7 +2105,7 @@ rt_dumpentry_ddb(struct radix_node *rn, void > *arg __un > > if (flags != rt->rt_flags) > db_printf(","); > - db_printf(rt_flag_name(idx)); > + db_printf("%s", rt_flag_name(idx)); > > flags &= ~(1ul << idx); > } > @@ -2374,8 +2374,12 @@ _DB_FUNC(_show, route, db_show_route_cmd, > db_show_tabl > u.dest_sin6.sin6_addr.s6_addr16[i] = > htons(hextets[i]); > dstp = (void *)&u.dest_sin6; > dst_addrp = &u.dest_sin6.sin6_addr; > - } else > + } else { > MPASS(false); > + /* UNREACHABLE */ > + /* Appease Clang false positive: */ > + dstp = NULL; > + } > > bp = inet_ntop(af, dst_addrp, buf, sizeof(buf)); > if (bp != NULL) > I don't think this was a false positive. MPASS resolves to KASSERT which resolves to nothing when built without INVARIANTS defined. So that comment is misleading, the code isn't unreachable, and after falling through, dstp is going to be dereferenced a few lines later. Instead of just squelching the coverity error, I think it should lead to the question: Does it make any sense to assert in a ddb command handler? Would it make more sense to make that else block do something like db_printf("Unexpected address family %d\n", af); goto exit; ? -- Ian