]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
afs: Only use actual connections for GetTime calls
authorAndrew Deason <adeason@sinenomine.net>
Wed, 2 Nov 2011 15:28:35 +0000 (10:28 -0500)
committerDerrick Brashear <shadow@dementix.org>
Fri, 4 Nov 2011 15:03:14 +0000 (08:03 -0700)
The for() loop that makes an RXAFS_GetTime call in afs_CheckServers
was iterating over conns and rxconns from 0 to j. However, 'j' here is
just the size of the allocated array, whereas 'nconns' is the number
of structures in the array actually initialized. So, just go up to
nconns to avoid using unitialized connections and Rx connections.

This is a 1.6-only change. On master, the -settime code has been
completely removed in change
Id291f5f88b1ad84594706f2a1a02a933dddd0cb9.

Issue reported by Sebastian Hanigk.

Change-Id: Iec782a4464899b5a7e49e193b04f79e31c6b37f2
Reviewed-on: http://gerrit.openafs.org/5788
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/afs/afs_server.c

index a9fd5d99370916ba9a00d2f3c7156fa8dfb604a0..fa211aa61b5e869aba5ea278bf3c33715bf36669 100644 (file)
@@ -693,7 +693,7 @@ afs_CheckServers(int adown, struct cell *acellp)
              } multi_End;
            }
        else {                  /* find and query setTimeHost only */
-           for ( i = 0 ; i < j ; i++ ) {
+           for ( i = 0 ; i < nconns ; i++ ) {
                if ( conns[i] == NULL || conns[i]->srvr == NULL )
                    continue;
                if ( conns[i]->srvr->server == afs_setTimeHost ) {