--- /opt/ecos/ecos-2.0/packages/net/bsd_tcpip/v2_0/src/sys/kern/uipc_socket.c 2003-02-12 10:29:52.000000000 -0500 +++ ./uipc_socket.c 2007-08-28 16:11:56.000000000 -0400 @@ -242,6 +246,11 @@ TAILQ_REMOVE(&head->so_incomp, so, so_list); head->so_incqlen--; } else if (so->so_state & SS_COMP) { + if((so->so_error == ECONNRESET) || + (so->so_error == ECONNREFUSED)){ // forced drop if flagged + TAILQ_REMOVE(&head->so_comp, so, so_list); + head->so_qlen--; + } else { /* * We must not decommission a socket that's * on the accept(2) queue. If we do, then @@ -249,11 +258,13 @@ * that the listening socket was ready. */ return; + } } else { panic("sofree: not queued"); } head->so_qlen--; so->so_state &= ~SS_INCOMP; + so->so_state &= ~SS_COMP; so->so_head = NULL; } sbrelease(&so->so_snd, so);