i dont think mbuf.h needs to bring in sys/queue.h because it doesnt use anything in it.
the malloc.h bits are only used to alias the mbuf allocator flags to the malloc ones, which is only necessary under _KERNEL. i think. hilariously the backend allocator for mbufs are pools too. an amd64 kernel build survives with this. is this worth doing? ok? Index: mbuf.h =================================================================== RCS file: /cvs/src/sys/sys/mbuf.h,v retrieving revision 1.208 diff -u -p -r1.208 mbuf.h --- mbuf.h 23 Feb 2016 01:39:14 -0000 1.208 +++ mbuf.h 30 Mar 2016 01:31:39 -0000 @@ -35,9 +35,6 @@ #ifndef _SYS_MBUF_H_ #define _SYS_MBUF_H_ -#include <sys/malloc.h> -#include <sys/queue.h> - /* * Constants related to network buffer management. * MCLBYTES must be no larger than PAGE_SIZE (the software page size) and, @@ -242,6 +239,7 @@ struct mbuf { #define M_FLOWID_MASK 0x7fff /* flow id to map to path */ /* flags to m_get/MGET */ +#include <sys/malloc.h> #define M_DONTWAIT M_NOWAIT #define M_WAIT M_WAITOK