Windows: if no known IP addrs, query the addr list

If cm_noIPAddrs == 0, then no servers will be probed.   If
syscfg_GetIFInfo() fails then cm_noIPAddrs is set to 0.  Therefore,
also set cm_LanAdapterChangeDetected to non-zero if syscfg_GetIFInfo()
fails so that the interface info can be queried again prior to a server
probe attempt.

Reviewed-on: http://gerrit.openafs.org/12055
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 4f20b7305efcea9d930f64c348fc58555a736c6b)

Change-Id: Iba740de83e360e2184262d98ae11bf2ae19948fe
Reviewed-on: http://gerrit.openafs.org/12060
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
Jeffrey Altman 2015-10-09 10:20:41 -04:00
parent 6186541109
commit 5a79a58f42

View File

@ -768,6 +768,17 @@ void cm_CheckServers(afs_uint32 flags, cm_cell_t *cellp)
DWORD dummyLen;
DWORD multi = 1;
lock_ObtainRead(&cm_syscfgLock);
if (cm_LanAdapterChangeDetected) {
lock_ConvertRToW(&cm_syscfgLock);
if (cm_LanAdapterChangeDetected) {
code = cm_UpdateIFInfo();
}
lock_ReleaseWrite(&cm_syscfgLock);
} else {
lock_ReleaseRead(&cm_syscfgLock);
}
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
0, KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
@ -864,7 +875,9 @@ afs_int32 cm_UpdateIFInfo(void)
code = syscfg_GetIFInfo(&cm_noIPAddr,
cm_IPAddr, cm_SubnetMask,
cm_NetMtu, cm_NetFlags);
cm_LanAdapterChangeDetected = 0;
cm_LanAdapterChangeDetected = (code != 0);
return code;
}