]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-viced-avoid-infinite-loop-with-altaddr-unset-20080508
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 17 Feb 2009 03:21:21 +0000 (03:21 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 17 Feb 2009 03:21:21 +0000 (03:21 +0000)
LICENSE IPL10

if we return leaving a non HOSTDELETED host while it does not have ALTADDR set,
a loop can happen. avoid it by simply setting ALTADDR again when we're done,
if we believe some addresses are still good this is fine.

(cherry picked from commit e6c818f070022529c362e42dfed340f54b2fd26e)

src/viced/host.c

index 6c6d572868bfce0389588c9efd9957c04d4f7f0c..5f473e1516c5b4f79c2463655b989737706105f6 100644 (file)
@@ -1529,6 +1529,7 @@ h_GetHost_r(struct rx_connection *tcon)
                             ntohs(host->port)));
                    host->hostFlags |= HOSTDELETED;
                    host->hostFlags &= ~HWHO_INPROGRESS;
+                   host->hostFlags |= ALTADDR;
                    h_Unlock_r(host);
                    if (!held)
                        h_Release_r(host);
@@ -1544,6 +1545,7 @@ h_GetHost_r(struct rx_connection *tcon)
                  */
                 removeAddress_r(host, haddr, hport);
                 host->hostFlags &= ~HWHO_INPROGRESS;
+               host->hostFlags |= ALTADDR;
                 h_Unlock_r(host);
                if (!held)
                    h_Release_r(host);
@@ -1579,6 +1581,7 @@ h_GetHost_r(struct rx_connection *tcon)
                    removeAddress_r(host, host->host, host->port);
                }
                host->hostFlags &= ~HWHO_INPROGRESS;
+               host->hostFlags |= ALTADDR;
                h_Unlock_r(host);
                if (!held)
                    h_Release_r(host);
@@ -1648,6 +1651,7 @@ h_GetHost_r(struct rx_connection *tcon)
                         afs_inet_ntoa_r(haddr, hoststr), ntohs(hport), code));
                removeAddress_r(host, haddr, hport);
                host->hostFlags &= ~HWHO_INPROGRESS;
+               host->hostFlags |= ALTADDR;
                h_Unlock_r(host);
                if (!held)
                    h_Release_r(host);