m_uiotombuf alignment

Andrew Thompson thompsa at FreeBSD.org
Tue Sep 2 17:45:50 UTC 2008


Hi,


I have a patch here to removing the alignment of the align parameter. I
can not see why it was added as it up to the caller to specify this, it
breaks tap(4) on strict alignment machines as m_uiotombuf is called with
ETHER_ALIGN. Also 'align' isnt a great description of this field, its
more a padding or data offset.

As far as I can see only SCTP uses this parameter in a non-trivial way
and may be affected if it has assumed the 4byte alignment. 
 

Andrew

Index: uipc_mbuf.c
===================================================================
--- uipc_mbuf.c	(revision 182549)
+++ uipc_mbuf.c	(working copy)
@@ -1732,10 +1732,8 @@ m_uiotombuf(struct uio *uio, int how, int len, int
 
 	/*
 	 * The smallest unit returned by m_getm2() is a single mbuf
-	 * with pkthdr.  We can't align past it.  Align align itself.
+	 * with pkthdr.  We can't align past it.
 	 */
-	if (align)
-		align &= ~(sizeof(long) - 1);
 	if (align >= MHLEN)
 		return (NULL);
 


More information about the freebsd-current mailing list