From 511909eef43c51e1bc4372a7e87cde8fe9248bd7 Mon Sep 17 00:00:00 2001 From: ae Date: Thu, 21 May 2015 08:28:35 +0000 Subject: [PATCH] MFC r282594: m_dup() is supposed to give a writable copy of an mbuf chain. It uses m_dup_pkthdr(), that uses M_COPYFLAGS mask to copy m_flags field. If original mbuf chain has M_RDONLY flag, its copy also will have it. Reset this flag explicitly. --- sys/kern/uipc_mbuf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index a16af57a85b3..01e4c310cb19 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -934,6 +934,7 @@ m_dup(struct mbuf *m, int how) } if ((n->m_flags & M_EXT) == 0) nsize = MHLEN; + n->m_flags &= ~M_RDONLY; } n->m_len = 0;