aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2004-06-20 21:47:12 +0000
committerRobert Watson <rwatson@FreeBSD.org>2004-06-20 21:47:12 +0000
commitcce9682e55d31dc1cbe06b43a0d965195b424b64 (patch)
treefad58d482f9df8b19a5a2a10163f0626c67730d3 /sys
parentd330008e3b40d56ef4982240349ed339afab70cb (diff)
downloadsrc-cce9682e55d31dc1cbe06b43a0d965195b424b64.tar.gz
src-cce9682e55d31dc1cbe06b43a0d965195b424b64.zip
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.
Notes
Notes: svn path=/head/; revision=130822
Diffstat (limited to 'sys')
-rw-r--r--sys/netipx/spx_usrreq.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c
index b9c7a1105ae2..a321cc828d1a 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);