Modification of a patch accepted by OpenBSD project:

--- uipc_mbuf.c.orig    Mon Oct 23 20:53:43 2006
+++ uipc_mbuf.c Mon Oct 23 20:55:30 2006
@@ -877,17 +877,16 @@
 }
 
 /*
- * Make a copy of an mbuf chain starting "off0" bytes from the beginning,
+ * Make a copy of an mbuf chain starting "off" bytes from the beginning,
  * continuing for "len" bytes.  If len is M_COPYALL, copy to end of mbuf.
  * The wait parameter is a choice of MB_WAIT/MB_DONTWAIT from caller.
  * Note that the copy is read-only, because clusters are not copied,
  * only their reference counts are incremented.
  */
 struct mbuf *
-m_copym(const struct mbuf *m, int off0, int len, int wait)
+m_copym(const struct mbuf *m, int off, int len, int wait)
 {
        struct mbuf *n, **np;
-       int off = off0;
        struct mbuf *top;
        int copyhdr = 0;
 
@@ -925,9 +924,7 @@
                if (copyhdr) {
                        if (!m_dup_pkthdr(n, m, wait))
                                goto nospace;
-                       if (len == M_COPYALL)
-                               n->m_pkthdr.len -= off0;
-                       else
+                       if (len != M_COPYALL)
                                n->m_pkthdr.len = len;
                        copyhdr = 0;
                }

off0 is unneeded, and the subtraction of a known 0 value is
removed.

I am not subscribed to this list; please cc me with any questions
or comments.

- Bret Lambert

Reply via email to