Author: ae
Date: Thu May  7 18:35:01 2015
New Revision: 282594
URL: https://svnweb.freebsd.org/changeset/base/282594

Log:
  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.
  
  MFC after:    2 weeks

Modified:
  head/sys/kern/uipc_mbuf.c

Modified: head/sys/kern/uipc_mbuf.c
==============================================================================
--- head/sys/kern/uipc_mbuf.c   Thu May  7 18:32:11 2015        (r282593)
+++ head/sys/kern/uipc_mbuf.c   Thu May  7 18:35:01 2015        (r282594)
@@ -813,6 +813,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;
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to