From: Marc Dionne Date: Sun, 22 Jan 2012 14:45:22 +0000 (-0500) Subject: viced: Allow null host for BreakCallBack X-Git-Tag: upstream/1.8.0_pre1^2~2770 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=01301d0a5323a836efaae30cac325c25f6a7577a;p=packages%2Fo%2Fopenafs.git viced: Allow null host for BreakCallBack For replication writes at the remote site, we will want to call this without a host structure. Change-Id: I9cdef18f35229c9ab162cc07f6d60fe443204654 Reviewed-on: http://gerrit.openafs.org/6674 Reviewed-by: Simon Wilkinson Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/viced/callback.c b/src/viced/callback.c index 07f52f6eb..a4fb61344 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -798,10 +798,15 @@ BreakCallBack(struct host *xhost, AFSFid * fid, int flag) int hostindex; char hoststr[16]; - ViceLog(7, - ("BCB: BreakCallBack(Host %p all but %s:%d, (%u,%u,%u))\n", - xhost, afs_inet_ntoa_r(xhost->host, hoststr), ntohs(xhost->port), - fid->Volume, fid->Vnode, fid->Unique)); + if (xhost) + ViceLog(7, + ("BCB: BreakCallBack(Host %p all but %s:%d, (%u,%u,%u))\n", + xhost, afs_inet_ntoa_r(xhost->host, hoststr), ntohs(xhost->port), + fid->Volume, fid->Vnode, fid->Unique)); + else + ViceLog(7, + ("BCB: BreakCallBack(No Host, (%u,%u,%u))\n", + fid->Volume, fid->Vnode, fid->Unique)); H_LOCK; cbstuff.BreakCallBacks++; @@ -809,7 +814,7 @@ BreakCallBack(struct host *xhost, AFSFid * fid, int flag) if (!fe) { goto done; } - hostindex = h_htoi(xhost); + hostindex = xhost ? h_htoi(xhost) : 0; cb = itocb(fe->firstcb); if (!cb || ((fe->ncbs == 1) && (cb->hhead == hostindex) && !flag)) { /* the most common case is what follows the || */