svn commit: r300167 - in head: contrib/bsnmp/snmpd usr.sbin/bsnmpd/bsnmpd

Chris Torek torek at elf.torek.net
Thu May 19 00:00:41 UTC 2016


>I don't know much about CMSG*, so I wouldn't have if you didn't ask :-).

One thing to know about the CMSG (control message) stuff is that
it is badly broken, at least on I32LP64 systems.  Not the CMSG_*
aligning macros themselves (the alignment is linked to stuff I did
back in the early sparc-port days, around 1992 or so), but
internally, when file descriptor rights are internalized before
sending.  This converts them from 32 bit "int"s to 64 bit
pointers, which winds up breaking other code.

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=181741
(I attached a revised set of patches that apply to current kernels,
adding a rewrite of the transform code for sanity / readability.)

>... So void * works better in all cases in the kernel.

If someone wanted to change CMSG_DATA, CMSG_FIRSTHDR, and
CMSG_NEXTHDR to produce "void *", I'd vote in favor of that. :-)

Chris


More information about the svn-src-head mailing list