summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2008-11-26 22:56:07 +0000
committerclaudio <claudio@openbsd.org>2008-11-26 22:56:07 +0000
commitba6eae0cb69322782e8167734d8111cf90ebd8b7 (patch)
treeb5eaa53f3dbb156d03af25a0dee52d5946ac3153
parentAdd unix(4) to SEE ALSO. (diff)
downloadwireguard-openbsd-ba6eae0cb69322782e8167734d8111cf90ebd8b7.tar.xz
wireguard-openbsd-ba6eae0cb69322782e8167734d8111cf90ebd8b7.zip
Do a quick return if m->m_next is NULL in m_defrag() because there is nothing
todo. Discussed with deraadt@ and dlg@
-rw-r--r--sys/kern/uipc_mbuf.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 08ed4b4f154..b0ce3d43e2f 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf.c,v 1.104 2008/11/26 21:39:57 deraadt Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.105 2008/11/26 22:56:07 claudio Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
@@ -374,8 +374,11 @@ m_defrag(struct mbuf *m, int how)
{
struct mbuf *m0;
+ if (m->m_next == NULL)
+ return;
+
#ifdef DIAGNOSTIC
- if (!(m->m_flags & M_PKTHDR) || m->m_next == NULL)
+ if (!(m->m_flags & M_PKTHDR))
panic("m_defrag: no packet hdr or not a chain");
#endif