don't remove socket from q's if not freeing
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Sat, 11 Jul 1987 00:08:50 +0000 (16:08 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Sat, 11 Jul 1987 00:08:50 +0000 (16:08 -0800)
(it confuses sonewconn, which removes it from q itself)

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

usr/src/sys/kern/uipc_socket.c

index 02ebd12..a3ed466 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)uipc_socket.c       7.2 (Berkeley) %G%
+ *     @(#)uipc_socket.c       7.3 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -121,13 +121,13 @@ sofree(so)
        register struct socket *so;
 {
 
        register struct socket *so;
 {
 
+       if (so->so_pcb || (so->so_state & SS_NOFDREF) == 0)
+               return;
        if (so->so_head) {
                if (!soqremque(so, 0) && !soqremque(so, 1))
                        panic("sofree dq");
                so->so_head = 0;
        }
        if (so->so_head) {
                if (!soqremque(so, 0) && !soqremque(so, 1))
                        panic("sofree dq");
                so->so_head = 0;
        }
-       if (so->so_pcb || (so->so_state & SS_NOFDREF) == 0)
-               return;
        sbrelease(&so->so_snd);
        sorflush(so);
        (void) m_free(dtom(so));
        sbrelease(&so->so_snd);
        sorflush(so);
        (void) m_free(dtom(so));