From John Wroclawski <jtw@lcs.mit.edu>
authorGarrett Wollman <wollman@FreeBSD.org>
Thu, 5 May 1994 23:48:00 +0000 (23:48 +0000)
committerGarrett Wollman <wollman@FreeBSD.org>
Thu, 5 May 1994 23:48:00 +0000 (23:48 +0000)
Fix two bugs in the mbuf code.

sys/kern/uipc_mbuf.c
sys/sys/mbuf.h

index 7db0c65..ca1b827 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *     from: @(#)uipc_mbuf.c   7.19 (Berkeley) 4/20/91
  * SUCH DAMAGE.
  *
  *     from: @(#)uipc_mbuf.c   7.19 (Berkeley) 4/20/91
- *     $Id: uipc_mbuf.c,v 1.6 1993/12/19 00:51:44 wollman Exp $
+ *     $Id: uipc_mbuf.c,v 1.7.1.1 1994/05/01 02:24:27 jtw Exp $
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -442,8 +442,8 @@ m_adj(mp, req_len)
                }
                if (m->m_len >= len) {
                        m->m_len -= len;
                }
                if (m->m_len >= len) {
                        m->m_len -= len;
-                       if ((mp = m)->m_flags & M_PKTHDR)
-                               m->m_pkthdr.len -= len;
+                       if (mp->m_flags & M_PKTHDR)
+                               mp->m_pkthdr.len -= len;
                        return;
                }
                count -= len;
                        return;
                }
                count -= len;
index 953eeca..93917c6 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *     from: @(#)mbuf.h        7.14 (Berkeley) 12/5/90
  * SUCH DAMAGE.
  *
  *     from: @(#)mbuf.h        7.14 (Berkeley) 12/5/90
- *     $Id: mbuf.h,v 1.7 1994/03/07 11:48:12 davidg Exp $
+ *     $Id: mbuf.h,v 1.8.1.1 1994/05/01 02:27:52 jtw Exp $
  */
 
 #ifndef _SYS_MBUF_H_
  */
 
 #ifndef _SYS_MBUF_H_
@@ -65,7 +65,7 @@
 #define mtod(m,t)      ((t)((m)->m_data))
 #define        dtom(x)         ((struct mbuf *)((int)(x) & ~(MSIZE-1)))
 #define        mtocl(x)        (((u_int)(x) - (u_int)mbutl) >> MCLSHIFT)
 #define mtod(m,t)      ((t)((m)->m_data))
 #define        dtom(x)         ((struct mbuf *)((int)(x) & ~(MSIZE-1)))
 #define        mtocl(x)        (((u_int)(x) - (u_int)mbutl) >> MCLSHIFT)
-#define        cltom(x)        ((caddr_t)((u_int)mbutl + ((u_int)(x) >> MCLSHIFT)))
+#define        cltom(x)        ((caddr_t)((u_int)mbutl + ((u_int)(x) << MCLSHIFT)))
 
 /* header at beginning of each mbuf: */
 struct m_hdr {
 
 /* header at beginning of each mbuf: */
 struct m_hdr {