From: Simon Wilkinson Date: Tue, 31 May 2011 07:31:55 +0000 (+0100) Subject: vos: print_addrs never receives multi-homed addrs X-Git-Tag: upstream/1.6.0.pre7^2~66 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=d68c66eb6e8d0df2612485f8c72e155513b6cc36;p=packages%2Fo%2Fopenafs.git vos: print_addrs never receives multi-homed addrs The magic address that tells the vlserver that a host is multi-homed, and to look up the multi-homed address structure is an internal implementation feature, which shouldn't be exposed to clients. print_addrs is only ever called with the results of VL_GetAddrsU, which has already converted any multi-homed pointers, so it doesn't need the logic to handle them itself. Reviewed-on: http://gerrit.openafs.org/4757 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit 23e433f10414d771937cbea5510b6006b6a7b063) Change-Id: I24df764211d99d84b116d1031b05de61b38c3397 Reviewed-on: http://gerrit.openafs.org/4792 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/volser/vos.c b/src/volser/vos.c index ef864fbb0..389e84689 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -5272,14 +5272,8 @@ static void print_addrs(const bulkaddrs * addrs, afsUUID * m_uuid, int nentries, int print) { - afs_int32 vcode, m_uniq=0; - afs_int32 i, j; + int i; afs_uint32 *addrp; - bulkaddrs m_addrs; - ListAddrByAttributes m_attrs; - afs_int32 m_nentries; - afs_uint32 *m_addrp; - afs_int32 base, index; char buf[1024]; if (print) { @@ -5290,56 +5284,6 @@ print_addrs(const bulkaddrs * addrs, afsUUID * m_uuid, int nentries, /* print out the list of all the server */ addrp = (afs_uint32 *) addrs->bulkaddrs_val; for (i = 0; i < nentries; i++, addrp++) { - /* If it is a multihomed address, then we will need to - * get the addresses for this multihomed server from - * the vlserver and print them. - */ - if (((*addrp & 0xff000000) == 0xff000000) && ((*addrp) & 0xffff)) { - /* Get the list of multihomed fileservers */ - base = (*addrp >> 16) & 0xff; - index = (*addrp) & 0xffff; - - if ((base >= 0) && (base <= VL_MAX_ADDREXTBLKS) && (index >= 1) - && (index <= VL_MHSRV_PERBLK)) { - m_attrs.Mask = VLADDR_INDEX; - m_attrs.index = (base * VL_MHSRV_PERBLK) + index; - m_nentries = 0; - m_addrs.bulkaddrs_val = 0; - m_addrs.bulkaddrs_len = 0; - vcode = - ubik_VL_GetAddrsU(cstruct, 0, &m_attrs, m_uuid, - &m_uniq, &m_nentries, - &m_addrs); - if (vcode) { - fprintf(STDERR, - "vos: could not list the multi-homed server addresses\n"); - PrintError("", vcode); - } - - /* Print the list */ - m_addrp = (afs_uint32 *) m_addrs.bulkaddrs_val; - for (j = 0; j < m_nentries; j++, m_addrp++) { - *m_addrp = htonl(*m_addrp); - if (noresolve) { - char hoststr[16]; - printf("%s ", afs_inet_ntoa_r(*m_addrp, hoststr)); - } else { - printf("%s ", hostutil_GetNameByINet(*m_addrp)); - } - } - if (j == 0) { - printf("\n"); - } else { - printf("\n"); - } - - continue; - } - } - - /* Otherwise, it is a non-multihomed entry and contains - * the IP address of the server - print it. - */ *addrp = htonl(*addrp); if (noresolve) { char hoststr[16];