darwin: stop processing upcalls once rx shutdown starts
[openafs.git] / src / rx / DARWIN / rx_knet.c
index def2994..d0d0f79 100644 (file)
@@ -22,6 +22,8 @@
 #endif
 
 #ifdef RXK_UPCALL_ENV
+extern rx_atomic_t rxinit_status;
+
 void
 rx_upcall(socket_t so, void *arg, __unused int waitflag)
 {
@@ -38,6 +40,10 @@ rx_upcall(socket_t so, void *arg, __unused int waitflag)
     afs_int32 savelen;          /* was using rlen but had aliasing problems */
     size_t nbytes, resid, noffset;
 
+    /* we stopped rx but the socket isn't closed yet */
+    if (rx_atomic_test_bit(&rxinit_status, 0))
+       return;
+
     /* See if a check for additional packets was issued */
     rx_CheckPackets();