(checked in by karels) treat MT_HEADER as MT_DATA in soreceive;
authorKeith Sklower <sklower@ucbvax.Berkeley.EDU>
Tue, 19 Feb 1991 09:13:20 +0000 (01:13 -0800)
committerKeith Sklower <sklower@ucbvax.Berkeley.EDU>
Tue, 19 Feb 1991 09:13:20 +0000 (01:13 -0800)
need to init len when MAPPED_MBUFS not defined

SCCS-vsn: sys/kern/uipc_socket.c 7.25

usr/src/sys/kern/uipc_socket.c

index eb6fef5..733be43 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)uipc_socket.c       7.24 (Berkeley) %G%
+ *     @(#)uipc_socket.c       7.25 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -369,7 +369,8 @@ restart:
                                if (top == 0) {
                                        len = min(MCLBYTES - max_hdr, resid);
                                        m->m_data += max_hdr;
                                if (top == 0) {
                                        len = min(MCLBYTES - max_hdr, resid);
                                        m->m_data += max_hdr;
-                               }
+                               } else
+                                       len = min(MCLBYTES, resid);
 #endif
                                space -= MCLBYTES;
                        } else {
 #endif
                                space -= MCLBYTES;
                        } else {
@@ -586,12 +587,17 @@ restart:
                if ((flags & MSG_PEEK) == 0)
                        m->m_nextpkt = nextrecord;
                type = m->m_type;
                if ((flags & MSG_PEEK) == 0)
                        m->m_nextpkt = nextrecord;
                type = m->m_type;
+               if (type == MT_OOBDATA)
+                       flags |= MSG_OOB;
        }
        moff = 0;
        offset = 0;
        }
        moff = 0;
        offset = 0;
-       while (m && m->m_type == type && uio->uio_resid > 0 && error == 0) {
-               if (m->m_type == MT_OOBDATA)
-                       flags |= MSG_OOB;
+       while (m && uio->uio_resid > 0 && error == 0) {
+               if (m->m_type == MT_OOBDATA) {
+                       if (type != MT_OOBDATA)
+                               break;
+               } else if (type == MT_OOBDATA)
+                       break;
 #ifdef DIAGNOSTIC
                else if (m->m_type != MT_DATA && m->m_type != MT_HEADER)
                        panic("receive 3");
 #ifdef DIAGNOSTIC
                else if (m->m_type != MT_DATA && m->m_type != MT_HEADER)
                        panic("receive 3");