Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Sep 2008 10:45:40 -0700
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        current@freebsd.org
Subject:   m_uiotombuf alignment
Message-ID:  <20080902174540.GB12367@citylink.fud.org.nz>

next in thread | raw e-mail | index | archive | help
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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080902174540.GB12367>