AFS_GUNLOCK();
for(cix = 0; cix < CVEC_LEN; ++cix) {
tc = &(tcv->cvec[cix]);
- if (tc->activated)
+ if (tc->activated) {
+ rx_SetConnSecondsUntilNatPing(tc->id, 0);
rx_DestroyConnection(tc->id);
+ }
}
if (glocked)
AFS_GLOCK();
AFS_GUNLOCK(); \
for(cix = 0; cix < CVEC_LEN; ++cix) {
tc = &(tcv->cvec[cix]);
- if (tc->activated)
- rx_DestroyConnection( tc->id );
+ if (tc->activated) {
+ rx_SetConnSecondsUntilNatPing(tc->id, 0);
+ rx_DestroyConnection(tc->id);
+ }
}
if (glocked)
AFS_GLOCK();
if (tc->id) {
if (glocked)
AFS_GUNLOCK();
- rx_DestroyConnection(tc->id);
+ rx_SetConnSecondsUntilNatPing(tc->id, 0);
+ rx_DestroyConnection(tc->id);
if (glocked)
AFS_GLOCK();
}
/* set to a RX_CALL_TIMEOUT error to allow MTU retry to trigger */
rx_SetServerConnIdleDeadErr(tc->id, RX_CALL_DEAD);
rx_SetConnIdleDeadTime(tc->id, afs_rx_idledead);
- rx_SetMsgsizeRetryErr(tc->id, RX_MSGSIZE);
/*
* Only do this for the base connection, not per-user.
* Will need to be revisited if/when CB gets security.
*/
if ((isec == 0) && (service != 52) && !(tu->states & UTokensBad) &&
- (tu->viceId == UNDEFVID))
+ (tu->viceId == UNDEFVID)
+#ifndef UKERNEL /* ukernel runs as just one uid anyway */
+ && (tu->uid == 0)
+#endif
+ )
rx_SetConnSecondsUntilNatPing(tc->id, 20);
tc->forceConnectFS = 0; /* apparently we're appropriately connected now */
AFS_STATCNT(afs_PutConn);
ac->refCount--;
if (ac->refCount < 0) {
- static int warned = 0;
- /* So, someone is 'put'ing more refs than they got. From now on, we
- * have no idea if the structure is actually still in use, so just
- * set the refcount to a really negative number to make it unlikely
- * that the count will ever reach 0 and the conn gets freed. This
- * leaks memory, but the alternative is panicing, or risking memory
- * corruption. */
- ac->refCount = -10000;
- if (!warned) {
- warned = 1;
- afs_warn("afs_PutConn: negative refCount with 0x%lx; this should "
- "not ever happen! Trying to carry on anyway, but please "
- "report this issue\n",
- (unsigned long)(uintptrsz)ac);
- }
- return;
+ osi_Panic("afs_PutConn: refcount imbalance 0x%lx %d",
+ (unsigned long)(uintptrsz)ac, (int)ac->refCount);
}
ac->parent->refCount--;
rx_PutConnection(rxconn);