From: dlg Date: Tue, 8 Feb 2022 11:28:19 +0000 (+0000) Subject: use sizeof(long) - 1 in m_pullup to determine payload alignment. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=75fb34f846d118dcb69097621031a067053af480;p=openbsd use sizeof(long) - 1 in m_pullup to determine payload alignment. this makes it consistent with the rest of the network stack when determining alignment. ok bluhm@ --- diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index bbb69322c05..acac2c0dbc8 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.280 2022/01/18 12:38:21 bluhm Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.281 2022/02/08 11:28:19 dlg Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -945,9 +945,9 @@ m_pullup(struct mbuf *m0, int len) goto freem0; } - adj = mtod(m, unsigned long) & ALIGNBYTES; + adj = mtod(m, unsigned long) & (sizeof(long) - 1); } else - adj = mtod(m0, unsigned long) & ALIGNBYTES; + adj = mtod(m0, unsigned long) & (sizeof(long) - 1); tail = head + M_SIZE(m0); head += adj;