struct srvAddr *next_sa; /* another interface on same host */
struct server *server; /* back to parent */
struct sa_conn_vector *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 */
int cix, glocked;
struct srvAddr *sa;
struct afs_conn *tc;
- struct sa_conn_vector *tcv, **lcv;
+ struct sa_conn_vector *tcv, **lcv, *tcvn;
for (sa = (xs)->addr; sa; sa = sa->next_sa) {
lcv = &sa->conns;
for (tcv = *lcv; tcv; lcv = &tcv->next, tcv = *lcv) {
if (tc->activated) {
rx_SetConnSecondsUntilNatPing(tc->id, 0);
rx_DestroyConnection(tc->id);
+ /* find another eligible connection */
+ if (sa->natping == tc) {
+ int cin;
+ struct afs_conn *tcn;
+ for (tcvn = sa->conns; tcvn; tcvn = tcvn->next) {
+ if (tcvn == tcv)
+ continue;
+ for(cin = 0; cin < CVEC_LEN; ++cin) {
+ tcn = &(tcvn->cvec[cin]);
+ if (tcn->activated) {
+ rx_SetConnSecondsUntilNatPing(tcn->id, 20);
+ sa->natping = tcn;
+ break;
+ }
+ }
+ }
+ }
}
}
if (glocked)
if (tc->activated) {
rx_SetConnSecondsUntilNatPing(tc->id, 0);
rx_DestroyConnection(tc->id);
+ if (tcv->srvr->natping == tc)
+ tcv->srvr->natping = NULL;
}
}
if (glocked)
UpgradeSToWLock(&afs_xconn, 38);
csec = (struct rx_securityClass *)0;
if (tc->id) {
+ if (sap->natping == tc)
+ sap->natping = NULL;
if (glocked)
AFS_GUNLOCK();
rx_SetConnSecondsUntilNatPing(tc->id, 0);
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->viceId == 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)