summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcmetz <cmetz@openbsd.org>1999-05-14 02:05:42 +0000
committercmetz <cmetz@openbsd.org>1999-05-14 02:05:42 +0000
commit81d1a49229832652bd337a8736b9556ff2514bb6 (patch)
tree97fc56569b73d552de7e15740087fbebf4074e8d
parentsync (diff)
downloadwireguard-openbsd-81d1a49229832652bd337a8736b9556ff2514bb6.tar.xz
wireguard-openbsd-81d1a49229832652bd337a8736b9556ff2514bb6.zip
m_zero will no longer zero the contents of a cluster if there's an alias to it.
(TCP uses cluster mbuf aliases for retransmission, and this would cause your data to get retransmitted zeroed-out)
-rw-r--r--sys/kern/uipc_mbuf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index f83ccb3ef41..8caae143a33 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf.c,v 1.10 1999/05/12 21:11:40 ho Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.11 1999/05/14 02:05:42 cmetz Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
@@ -860,7 +860,8 @@ m_zero(m)
sizeof(struct pkthdr), MHLEN);
else
bzero((void *)m + sizeof(struct m_hdr), MLEN);
- if (m->m_flags & M_EXT)
+ if ((m->m_flags & M_EXT) && !m->m_ext.ext_func &&
+ !mclrefcnt[mtocl((m)->m_ext.ext_buf)])
bzero(m->m_ext.ext_buf, m->m_ext.ext_size);
m = m->m_next;
}