svn commit: r299830 - head/contrib/bsnmp/snmpd

Gleb Smirnoff glebius at FreeBSD.org
Wed May 18 18:21:37 UTC 2016


  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.


More information about the svn-src-head mailing list