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>
#endif
#ifdef RXK_UPCALL_ENV
+extern int rxinit_status;
+
void
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 */
* 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;