]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
darwin: don't process incoming packets during rx shutdown
authorDerrick Brashear <shadow@your-file-system.com>
Tue, 22 Jan 2013 20:00:29 +0000 (15:00 -0500)
committerRuss Allbery <rra@debian.org>
Mon, 8 Apr 2013 18:09:52 +0000 (11:09 -0700)
we have a chicken and egg problem because the kpi doesn't
let us kill the upcall before we close a socket. a more correct
fix (on master) uses atomics, but for 1.6 this is a minimally-invasive
fix, macos only and strictly better than before.

FIXES 131577

Change-Id: I6003679f709284ae28f51bf5de8deff873346819
Reviewed-on: http://gerrit.openafs.org/8937
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
src/rx/DARWIN/rx_knet.c
src/rx/rx.c

index fcf3f3478a6e1857f3f98a42116b344712a1f910..b3aa3a2b88b4e20867654c5ac674164671154421 100644 (file)
@@ -18,6 +18,8 @@
 #endif
 
 #ifdef RXK_UPCALL_ENV
+extern int rxinit_status;
+
 void
 rx_upcall(socket_t so, void *arg, __unused int waitflag)
 {
@@ -34,6 +36,11 @@ 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;
 
+    /* if rx is shut down, but the socket is not closed yet, we
+       can't process packets. just return now. */
+    if (rxinit_status)
+       return;
+
     p = rxi_AllocPacket(RX_PACKET_CLASS_RECEIVE);
     rx_computelen(p, tlen);
     rx_SetDataSize(p, tlen);    /* this is the size of the user data area */
index 7982c77942825a7aec88f9ad41bc5f01066c4617..dfcd3c5c4b392249162f1fee0b6b26046ee8b285 100644 (file)
@@ -441,7 +441,7 @@ rx_SetEpoch(afs_uint32 epoch)
  * by the kernel.  Whether this will ever overlap anything in
  * /etc/services is anybody's guess...  Returns 0 on success, -1 on
  * error. */
-#ifndef AFS_NT40_ENV
+#if !(defined(AFS_NT40_ENV) || defined(RXK_UPCALL_ENV))
 static
 #endif
 int rxinit_status = 1;