Date: Wed, 18 May 2016 13:07:01 -0700 From: Ngie Cooper <yaneurabeya@gmail.com> To: Gleb Smirnoff <glebius@FreeBSD.org> Cc: Garrett Cooper <ngie@FreeBSD.org>, 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: <7C423729-7685-41B8-9813-FF02A02B587A@gmail.com> In-Reply-To: <20160518182135.GL1015@FreeBSD.org> References: <201605150336.u4F3aJxd062168@repo.freebsd.org> <20160518182135.GL1015@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> On May 18, 2016, at 11:21, Gleb Smirnoff <glebius@FreeBSD.org> wrote: >=20 > Garrett, >=20 > 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>=20 > G> Log: > G> Fix -Wcast-align warnings > G> =20 > G> Use memcpy instead of using direct assignment of void* pointers with > G> CMSG_DATA(..), which changes alignment > G> =20 > G> MFC after: 3 weeks > G> Reported by: clang > G> Sponsored by: EMC / Isilon Storage Division > G>=20 > G> Modified: > G> head/contrib/bsnmp/snmpd/main.c > G>=20 > G> Modified: head/contrib/bsnmp/snmpd/main.c > G> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D > G> --- head/contrib/bsnmp/snmpd/main.c Sun May 15 03:22:13 2016 (r29= 9829) > G> +++ head/contrib/bsnmp/snmpd/main.c Sun May 15 03:36:19 2016 (r29= 9830) > 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 =3D=3D SOL_SOCKET && > G> cmsg->cmsg_type =3D=3D SCM_CREDS) > G> - cred =3D (struct sockcred *)CMSG_DATA(cmsg); > G> + memcpy(cred, CMSG_DATA(cmsg), sizeof(struct sockcred)); >=20 > And cred is always NULL at this point, isn't it? markj noted this as well. This is the one commit I should have had reviewed b= y other folks because I missed this point. I'll revert the commit, mute the warning, and move on... Every time I've tri= ed fixing CMSG I've ended up with headaches, so... I'm likely not the right p= erson to be fixing these issues. Thanks, -Ngie=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7C423729-7685-41B8-9813-FF02A02B587A>