From cce9682e55d31dc1cbe06b43a0d965195b424b64 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Sun, 20 Jun 2004 21:47:12 +0000 Subject: It's now the responsibility of the consumer of soabort() to remove a socket from its accept queue when aborting it during a new inbound connection. Update spx_input() to acquire the accept lock, assert the condition of the socket on its parent queue, and approriately disconnect it from the queue before calling soabort() on it. --- sys/netipx/spx_usrreq.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c index b9c7a1105ae2f..a321cc828d1af 100644 --- a/sys/netipx/spx_usrreq.c +++ b/sys/netipx/spx_usrreq.c @@ -314,8 +314,19 @@ spx_input(m, ipxp) return; dropwithreset: - if (dropsocket) + if (dropsocket) { + struct socket *head; + ACCEPT_LOCK(); + KASSERT((so->so_qstate & SQ_INCOMP) != 0, + ("spx_input: nascent socket not SQ_INCOMP on soabort()")); + head = so->so_head; + TAILQ_REMOVE(&head->so_incomp, so, so_list); + head->so_incqlen--; + so->so_qstate &= ~SQ_INCOMP; + so->so_head = NULL; + ACCEPT_UNLOCK(); soabort(so); + } si->si_seq = ntohs(si->si_seq); si->si_ack = ntohs(si->si_ack); si->si_alo = ntohs(si->si_alo); -- cgit v1.3