From owner-svn-src-all@freebsd.org Wed May 18 18:21:37 2016 Return-Path: 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 3BEFEB402EC; Wed, 18 May 2016 18:21:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 278F8123F; Wed, 18 May 2016 18:21:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u4IILZZq046012 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 18 May 2016 11:21:36 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u4IILZ1a046011; Wed, 18 May 2016 11:21:35 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 18 May 2016 11:21:35 -0700 From: Gleb Smirnoff To: Garrett Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299830 - head/contrib/bsnmp/snmpd Message-ID: <20160518182135.GL1015@FreeBSD.org> References: <201605150336.u4F3aJxd062168@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605150336.u4F3aJxd062168@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 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: Wed, 18 May 2016 18:21:37 -0000 Garrett, On Sun, May 15, 2016 at 03:36:19AM +0000, Garrett Cooper wrote: G> Author: ngie G> Date: Sun May 15 03:36:19 2016 G> New Revision: 299830 G> URL: https://svnweb.freebsd.org/changeset/base/299830 G> G> Log: G> Fix -Wcast-align warnings G> G> Use memcpy instead of using direct assignment of void* pointers with G> CMSG_DATA(..), which changes alignment G> G> MFC after: 3 weeks G> Reported by: clang G> Sponsored by: EMC / Isilon Storage Division G> G> Modified: G> head/contrib/bsnmp/snmpd/main.c G> G> Modified: head/contrib/bsnmp/snmpd/main.c G> ============================================================================== G> --- head/contrib/bsnmp/snmpd/main.c Sun May 15 03:22:13 2016 (r299829) G> +++ head/contrib/bsnmp/snmpd/main.c Sun May 15 03:36:19 2016 (r299830) G> @@ -1169,7 +1169,7 @@ recv_dgram(struct port_input *pi, struct G> memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); G> if (cmsg->cmsg_level == SOL_SOCKET && G> cmsg->cmsg_type == SCM_CREDS) G> - cred = (struct sockcred *)CMSG_DATA(cmsg); G> + memcpy(cred, CMSG_DATA(cmsg), sizeof(struct sockcred)); And cred is always NULL at this point, isn't it? -- Totus tuus, Glebius.