track the natping conn with the srvAddr, ensuring exactly one.
Reviewed-on: http://gerrit.openafs.org/6706
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
2378895fc66a19a050f302711f2e18dbbf2e3d6f)
Change-Id: I5e74ec3f46f9af335653b6910d2c31c788181c5c
Reviewed-on: http://gerrit.openafs.org/6772
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
struct srvAddr *next_bkt; /* next item in hash bucket */
struct srvAddr *next_sa; /* another interface on same host */
struct server *server; /* back to parent */
- struct afs_conn *conns; /* All user connections to this server */
+ struct afs_conn *conns; /* All user connections to this server */
+ struct afs_conn *natping;
afs_int32 sa_ip; /* Host addr in network byte order */
u_short sa_iprank; /* indiv ip address priority */
u_short sa_portal; /* port addr in network byte order */
rx_SetConnSecondsUntilNatPing(tc->id, 0);
rx_DestroyConnection(tc->id);
AFS_GLOCK();
+ if (sap->natping == tc)
+ sap->natping = NULL;
}
/*
* Stupid hack to determine if using vldb service or file system
rx_SetConnIdleDeadTime(tc->id, afs_rx_idledead);
/*
- * Only do this for the base connection, not per-user.
- * Will need to be revisited if/when CB gets security.
+ * Only do this for one connection
*/
- if ((isec == 0) && (service != 52) && !(tu->states & UTokensBad) &&
- (tu->vid == UNDEFVID) && (isrep == 0)
-#ifndef UKERNEL /* ukernel runs as just one uid anyway */
- && (tu->uid == 0)
-#endif
- )
+ if ((service != 52) && (sap->natping == NULL)) {
+ sap->natping = tc;
rx_SetConnSecondsUntilNatPing(tc->id, 20);
+ }
tc->forceConnectFS = 0; /* apparently we're appropriately connected now */
if (csec)
tc = ntc;
}
sa->conns = NULL;
+ sa->natping = NULL;
}
}
}
if (tc->user == au && tc->refCount == 0) {
*lc = tc->next;
AFS_GUNLOCK();
+ rx_SetConnSecondsUntilNatPing(tc->id, 0);
rx_DestroyConnection(tc->id);
AFS_GLOCK();
+ if (tc->srvr->natping == tc) {
+ struct afs_conn *nc = sa->conns;
+ if (nc == tc)
+ nc = *lc;
+ if (nc && nc->id) {
+ rx_SetConnSecondsUntilNatPing((nc->id), 20);
+ tc->srvr->natping = nc;
+ }
+ }
afs_osi_Free(tc, sizeof(struct afs_conn));
break; /* at most one instance per server */
} /*Found unreferenced connection for user */