summaryrefslogtreecommitdiffstats
path: root/sys/netinet/accf_data.c
diff options
context:
space:
mode:
authortanimura <tanimura@FreeBSD.org>2002-04-27 08:24:29 +0000
committertanimura <tanimura@FreeBSD.org>2002-04-27 08:24:29 +0000
commitdbb4756491715a06ce4578841f6eba43fc62fa70 (patch)
tree982f8e96f9de9e219deaa4ea138a8334dc086c3c /sys/netinet/accf_data.c
parentbcaaa89ad095d7a175927dd7e531fa6f278ed18e (diff)
downloadFreeBSD-src-dbb4756491715a06ce4578841f6eba43fc62fa70.zip
FreeBSD-src-dbb4756491715a06ce4578841f6eba43fc62fa70.tar.gz
Add a global sx sigio_lock to protect the pointer to the sigio object
of a socket. This avoids lock order reversal caused by locking a process in pgsigio(). sowakeup() and the callers of it (sowwakeup, soisconnected, etc.) now require sigio_lock to be locked. Provide sowwakeup_locked(), soisconnected_locked(), and so on in case where we have to modify a socket and wake up a process atomically.
Diffstat (limited to 'sys/netinet/accf_data.c')
-rw-r--r--sys/netinet/accf_data.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet/accf_data.c b/sys/netinet/accf_data.c
index b66e1c7..d38b165 100644
--- a/sys/netinet/accf_data.c
+++ b/sys/netinet/accf_data.c
@@ -56,12 +56,15 @@ static void
sohasdata(struct socket *so, void *arg, int waitflag)
{
+ SIGIO_SLOCK();
if (!soreadable(so)) {
+ SIGIO_SUNLOCK();
return;
}
so->so_upcall = NULL;
so->so_rcv.sb_flags &= ~SB_UPCALL;
- soisconnected(so);
+ soisconnected_locked(so);
+ SIGIO_SUNLOCK();
return;
}
OpenPOWER on IntegriCloud