From e4b59c633962d7784485f8e2d4185edaf91bf23d Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 22 Dec 2010 23:23:48 -0500 Subject: [PATCH] Windows: fs checkservers should list vldb as well The Windows fs checkservers has only listed offline file servers. Include vldb as well to match the Unix cache manager. Change-Id: I81b8e4a1a813fcd8f19e3dc58c75ef161795518c Reviewed-on: http://gerrit.openafs.org/3602 Tested-by: BuildBot Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman --- src/WINNT/afsd/cm_ioctl.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/WINNT/afsd/cm_ioctl.c b/src/WINNT/afsd/cm_ioctl.c index 1624cbfc58..91c9604b97 100644 --- a/src/WINNT/afsd/cm_ioctl.c +++ b/src/WINNT/afsd/cm_ioctl.c @@ -1268,10 +1268,20 @@ cm_IoctlCheckServers(struct cm_ioctl *ioctlp, struct cm_user *userp) for (tsp = cm_allServersp; tsp; tsp=tsp->allNextp) { if (cellp && tsp->cellp != cellp) continue; /* cell spec'd and wrong */ - if ((tsp->flags & CM_SERVERFLAG_DOWN) - && tsp->type == CM_SERVER_FILE) { - memcpy(cp, (char *)&tsp->addr.sin_addr.s_addr, sizeof(long)); - cp += sizeof(long); + if (tsp->flags & CM_SERVERFLAG_DOWN) { + /* + * all server types are being reported by ipaddr. only report + * a server once regardless of how many services are down. + */ + for (tp = ioctlp->outDatap; tp < cp; tp += sizeof(long)) { + if (!memcmp(tp, (char *)&tsp->addr.sin_addr.s_addr, sizeof(long))) + break; + } + + if (tp == cp) { + memcpy(cp, (char *)&tsp->addr.sin_addr.s_addr, sizeof(long)); + cp += sizeof(long); + } } } lock_ReleaseRead(&cm_serverLock);