]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
auth: failback to afs3-vlserver for afs3-prserver
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 18 May 2011 17:51:53 +0000 (13:51 -0400)
committerDerrick Brashear <shadow@dementia.org>
Thu, 19 May 2011 15:34:30 +0000 (08:34 -0700)
If the DNS SRV lookup is for afs3-prserver or afs3-kaserver,
fallback to a lookup for afs3-vlserver since those services
are traditionally hosted on the same machine as the vlserver.

FIXES 129887

Reviewed-on: http://gerrit.openafs.org/4676
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 19f4fa2b4870828269e0751a4874d9ce67a1bb3a)

Change-Id: I9d0e2f0ca9d4ddc5ebf9defb44c62f6bf00955d6
Reviewed-on: http://gerrit.openafs.org/4681
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/auth/cellconfig.c

index bc1b3efc82e884b6ba4b2cfaa196173606a97798..ad95a9b53eccd61645a6afb2ba3e2a7e8a979896 100644 (file)
@@ -1229,6 +1229,21 @@ afsconf_GetAfsdbInfo(char *acellName, char *aservice,
                                ports, ipRanks, &numServers, &ttl,
                                &realCellName);
 
+    /* If we couldn't find an entry for the requested service
+     * and that service happens to be the prservice or kaservice
+     * then fallback to searching for afs3-vlserver and assigning
+     * the port number here. */
+    if (code < 0 && (afsdbport == htons(7002) || afsdbport == htons(7004))) {
+        code = afsconf_LookupServer("afs3-vlserver", "udp",
+                                    (const char *)acellName, afsdbport,
+                                    cellHostAddrs, cellHostNames,
+                                    ports, ipRanks, &numServers, &ttl,
+                                    &realCellName);
+        if (code >= 0) {
+            for (i = 0; i < numServers; i++)
+                ports[i] = afsdbport;
+        }
+    }
     if (code == 0) {
        acellInfo->timeout = ttl;
        acellInfo->numServers = numServers;
@@ -1291,7 +1306,7 @@ afsconf_GetAfsdbInfo(char *acellName, char *aservice,
      * and that service happens to be the prservice or kaservice
      * then fallback to searching for afs3-vlserver and assigning
      * the port number here. */
-    if (rc < 0 && tservice == htons(7002) || tservice == htons(7004)) {
+    if (rc < 0 && (tservice == htons(7002) || tservice == htons(7004))) {
         rc = getAFSServer("afs3-vlserver", "udp", acellName, tservice,
                            cellHostAddrs, cellHostNames, ports, ipRanks, &numServers,
                            &ttl);