From: Jeffrey Altman Date: Tue, 11 Aug 2009 12:43:53 +0000 (-0400) Subject: Windows: Avoid unnecessary DNS lookups X-Git-Tag: openafs-devel-1_5_62~56 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=d6071aa6e5f93cf9f9dd42c0c49d56416cfdabbe;p=packages%2Fo%2Fopenafs.git Windows: Avoid unnecessary DNS lookups Windows will attempt to open connections to a broad range of pipe service (share) names which do not contain a dot in them. Attempts to search for these names as cell names in DNS result in timeouts and sluggish behavior when browsing \\AFS in the Explorer Shell. To avoid this problem, do not perform a DNS lookup for a cellname that doesn't not contain a dot in it. LICENSE MIT Reviewed-on: http://gerrit.openafs.org/302 Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsd/cm_config.c b/src/WINNT/afsd/cm_config.c index eaaba81b3..e525a1790 100644 --- a/src/WINNT/afsd/cm_config.c +++ b/src/WINNT/afsd/cm_config.c @@ -689,8 +689,16 @@ long cm_SearchCellByDNS(char *cellNamep, char *newCellNamep, int *ttl, #ifdef CELLSERV_DEBUG osi_Log1(afsd_logp,"SearchCellDNS-Doing search for [%s]", osi_LogSaveString(afsd_logp,cellNamep)); #endif - if ( IsWindowsModule(cellNamep) ) + /* + * Do not perform a DNS lookup if the name is + * either a well-known Windows DLL or directory, + * or if the name does not contain a top-level + * domain. + */ + if ( IsWindowsModule(cellNamep) || + cm_FsStrChr(cellNamep, '.') == NULL) return -1; + rc = getAFSServer(cellNamep, cellHostAddrs, cellHostNames, ipRanks, &numServers, ttl); if (rc == 0 && numServers > 0) { /* found the cell */ for (i = 0; i < numServers; i++) {