From owner-freebsd-current@FreeBSD.ORG Tue Sep 2 17:45:50 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0516D106564A for ; Tue, 2 Sep 2008 17:45:50 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id BD9558FC1C for ; Tue, 2 Sep 2008 17:45:49 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 7FDC42BCB2 for ; Wed, 3 Sep 2008 05:45:48 +1200 (NZST) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id scSieg8udp3U for ; Wed, 3 Sep 2008 05:45:41 +1200 (NZST) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP for ; Wed, 3 Sep 2008 05:45:41 +1200 (NZST) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 64D511142A; Wed, 3 Sep 2008 05:45:40 +1200 (NZST) Date: Tue, 2 Sep 2008 10:45:40 -0700 From: Andrew Thompson To: current@freebsd.org Message-ID: <20080902174540.GB12367@citylink.fud.org.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Subject: m_uiotombuf alignment X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2008 17:45:50 -0000 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);