From 9020e6e2f0357b1082705dcaa6626573433969ec Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Fri, 22 Apr 2011 21:24:34 -0400 Subject: [PATCH] ubik: Defer updateUbikNetworkAddress until after RX startup The beacon package initialization has been moved to precede starting RX services, but the broadcast of addresses to other servers should be deferred until after RX is started. Make updateUbikNetworkAddress an exported function and call it from the general initilization sequence. Change-Id: I903398ed275f460cc8373340eed9dac6a560e1da Reviewed-on: http://gerrit.openafs.org/4525 Reviewed-by: Jeffrey Altman Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/ubik/beacon.c | 12 +++--------- src/ubik/ubik.c | 5 +++++ src/ubik/ubik.p.h | 1 + 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ubik/beacon.c b/src/ubik/beacon.c index 2acc6129e..eb2d5264d 100644 --- a/src/ubik/beacon.c +++ b/src/ubik/beacon.c @@ -62,8 +62,6 @@ static int ubeacon_InitServerListCommon(afs_uint32 ame, afs_uint32 aservers[]); static int verifyInterfaceAddress(afs_uint32 *ame, struct afsconf_cell *info, afs_uint32 aservers[]); -static int updateUbikNetworkAddress(afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR]); - /*! \file * Module responsible for both deciding if we're currently the sync site, @@ -358,10 +356,6 @@ ubeacon_InitServerListCommon(afs_uint32 ame, struct afsconf_cell *info, nServers = i + 1; /* count this server as well as the remotes */ ubik_quorum = (nServers >> 1) + 1; /* compute the majority figure */ - /* send addrs to all other servers */ - code = updateUbikNetworkAddress(ubik_host); - if (code) - return code; /* Shoud we set some defaults for RX?? r_retryInterval = 2; @@ -737,14 +731,14 @@ verifyInterfaceAddress(afs_uint32 *ame, struct afsconf_cell *info, * * \param ubik_host an array containing all my IP addresses. * - * Algorithm : Do an RPC to all remote ubik servers infroming them + * Algorithm : Do an RPC to all remote ubik servers informing them * about my IP addresses. Get their IP addresses and * update my linked list of ubik servers \p ubik_servers * * \return 0 on success, non-zero on failure */ -static int -updateUbikNetworkAddress(afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR]) +int +ubeacon_updateUbikNetworkAddress(afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR]) { int j, count, code = 0; UbikInterfaceAddr inAddr, outAddr; diff --git a/src/ubik/ubik.c b/src/ubik/ubik.c index ae8c35032..14992daba 100644 --- a/src/ubik/ubik.c +++ b/src/ubik/ubik.c @@ -513,6 +513,11 @@ ubik_ServerInitCommon(afs_uint32 myHost, short myPort, NULL, "rx_ServerProc", &junk); #endif + /* send addrs to all other servers */ + code = ubeacon_updateUbikNetworkAddress(ubik_host); + if (code) + return code; + /* now start up async processes */ #ifdef AFS_PTHREAD_ENV ubik_thread_create(&ubeacon_Interact_tattr, &ubeacon_InteractThread, diff --git a/src/ubik/ubik.p.h b/src/ubik/ubik.p.h index 1d0834f2e..3c53d5a25 100644 --- a/src/ubik/ubik.p.h +++ b/src/ubik/ubik.p.h @@ -518,6 +518,7 @@ extern int ubeacon_InitServerListByInfo(afs_uint32 ame, char clones[]); extern int ubeacon_InitServerList(afs_uint32 ame, afs_uint32 aservers[]); extern void *ubeacon_Interact(void *); +extern int ubeacon_updateUbikNetworkAddress(afs_uint32 ubik_host[]); extern struct beacon_data beacon_globals; extern struct addr_data addr_globals; -- 2.39.5