Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 May 2016 11:21:35 -0700
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Garrett Cooper <ngie@FreeBSD.org>
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>
In-Reply-To: <201605150336.u4F3aJxd062168@repo.freebsd.org>
References:  <201605150336.u4F3aJxd062168@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
  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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160518182135.GL1015>