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

Ngie Cooper yaneurabeya at gmail.com
Wed May 18 20:14:13 UTC 2016


> On May 18, 2016, at 11:21, Gleb Smirnoff <glebius at FreeBSD.org> wrote:
> 
>  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?

markj noted this as well. This is the one commit I should have had reviewed by other folks because I missed this point.

I'll revert the commit, mute the warning, and move on... Every time I've tried fixing CMSG I've ended up with headaches, so... I'm likely not the right person to be fixing these issues.

Thanks,
-Ngie


More information about the svn-src-head mailing list