From: Andrew Deason Date: Fri, 28 Dec 2012 18:16:49 +0000 (-0500) Subject: viced: initInterfaceAddr_r regardless of ICBS code X-Git-Tag: upstream/1.6.3^2~48 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=fcab44631cb5f3bac63eedfc25703aedff336c70;p=packages%2Fo%2Fopenafs.git viced: initInterfaceAddr_r regardless of ICBS code Currently we only call initInterfaceAddr_r for a host if a call to RXAFS_InitCallBackState3 succeeds. However, this leaves the host without a host->interface structure, which indicates that the host does not support UUIDs, and is represented by just a single host,port pair. But this is not correct; the host probably does have the relevant UUID associated with it, but it is just not responding. So, with the current code, we create a uuid-less host structure for a host that probably has a uuid; that host structure will probably never be used, and will just get deleted later. So instead, always call initInterfaceAdd_r. Do it before the ICBS call, so the host will be findable via UUID as early as possible. If the ICBS call fails, the host will be marked as 'down' later on. Reviewed-on: http://gerrit.openafs.org/8847 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit f2f7ba50ed61a6187814d633327a8cacda0f656f) Change-Id: I4847ec0350346d44883b5c5912867555292cf3db Reviewed-on: http://gerrit.openafs.org/9380 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Derrick Brashear Reviewed-by: Benjamin Kaduk Reviewed-by: Michael Meffie Reviewed-by: Stephan Wiesand --- diff --git a/src/viced/host.c b/src/viced/host.c index d79e7d838..64a766b8c 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -2184,6 +2184,9 @@ h_GetHost_r(struct rx_connection *tcon) /* the new host is held and locked */ } else { /* This really is a new host */ + osi_Assert(interfValid == 1); + initInterfaceAddr_r(host, &interf); + cb_conn = host->callback_rxcon; rx_GetConnection(cb_conn); H_UNLOCK; @@ -2198,8 +2201,6 @@ h_GetHost_r(struct rx_connection *tcon) ("InitCallBackState3 success on host %" AFS_PTR_FMT " (%s:%d)\n", host, afs_inet_ntoa_r(host->host, hoststr), ntohs(host->port))); - osi_Assert(interfValid == 1); - initInterfaceAddr_r(host, &interf); } } }