afs: prevent nat pings on destroyed connections
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 5 Dec 2011 04:15:13 +0000 (23:15 -0500)
committerDerrick Brashear <shadow@dementix.org>
Mon, 5 Dec 2011 16:18:10 +0000 (08:18 -0800)
If the connection is no longer in use, reset the nat keep alive
timer to 0 seconds.

Change-Id: I72b69979fb8b15ab5afaa654b317edc254253b4b
Reviewed-on: http://gerrit.openafs.org/6230
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

src/afs/afs_conn.c

index f63ac63..a136c8d 100644 (file)
@@ -146,8 +146,10 @@ release_conns_user_server(struct unixuser *xu, struct server *xs)
                     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();
@@ -175,8 +177,10 @@ release_conns_vector(struct sa_conn_vector *xcv)
             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();
@@ -431,7 +435,8 @@ afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell,
        if (tc->id) {
            if (glocked)
                 AFS_GUNLOCK();
-           rx_DestroyConnection(tc->id);
+            rx_SetConnSecondsUntilNatPing(tc->id, 0);
+            rx_DestroyConnection(tc->id);
            if (glocked)
                 AFS_GLOCK();
        }