summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_socket.c
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>1999-02-02 07:23:28 +0000
committerfenner <fenner@FreeBSD.org>1999-02-02 07:23:28 +0000
commit20e9c3a9ba50b4a863673d243a0423a6919d51f9 (patch)
treebb5f86d0140a0d1e418f117d83bc59d37756cf4e /sys/kern/uipc_socket.c
parentc97188153abd2cd4375d716062ff304be4849d4e (diff)
downloadFreeBSD-src-20e9c3a9ba50b4a863673d243a0423a6919d51f9.zip
FreeBSD-src-20e9c3a9ba50b4a863673d243a0423a6919d51f9.tar.gz
Fix the port of the NetBSD 19990120-accept fix. I misread a piece of
code when examining their fix, which caused my code (in rev 1.52) to: - panic("soaccept: !NOFDREF") - fatal trap 12, with tracebacks going thru soclose and soaccept
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r--sys/kern/uipc_socket.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 9e953da..1a18761 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94
- * $Id: uipc_socket.c,v 1.52 1999/01/25 16:58:52 fenner Exp $
+ * $Id: uipc_socket.c,v 1.53 1999/01/27 21:49:57 dillon Exp $
*/
#include <sys/param.h>
@@ -199,11 +199,12 @@ sofree(so)
* accept(2) may hang after select(2) indicated
* that the listening socket was ready.
*/
+ return;
} else {
panic("sofree: not queued");
}
head->so_qlen--;
- so->so_state &= ~(SS_INCOMP|SS_COMP);
+ so->so_state &= ~SS_INCOMP;
so->so_head = NULL;
}
sbrelease(&so->so_snd);
@@ -233,7 +234,11 @@ soclose(so)
}
for (sp = so->so_comp.tqh_first; sp != NULL; sp = sonext) {
sonext = sp->so_list.tqe_next;
+ /* Dequeue from so_comp since sofree() won't do it */
TAILQ_REMOVE(&so->so_comp, sp, so_list);
+ so->so_qlen--;
+ sp->so_state &= ~SS_COMP;
+ sp->so_head = NULL;
(void) soabort(sp);
}
}
OpenPOWER on IntegriCloud