]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Darwin: Assign correct value to myDstaddr in afsi_SetServerIPRank()
authorAntoine Verheijen <antoine@ualberta.ca>
Wed, 1 Dec 2010 18:54:23 +0000 (11:54 -0700)
committerDerrick Brashear <shadow@dementia.org>
Mon, 6 Dec 2010 20:46:10 +0000 (12:46 -0800)
The value in sin->sin_addr.s_addr that's assigned to myDstaddr in the
Darwin version of afsi_SetServerIPRank() is in network byte order but
really needs to be in host byte order.

Note: This patch assumes that change I66f5c790d8c55b359e3550b6d71f3abe040a2820
      has been previously installed. The patch fails otherwise.
Reviewed-on: http://gerrit.openafs.org/3402
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 2822416059fe192dc7e3c261b1e93510f2f10f3e)
Change-Id: I6fba524733ecf35e60419d449838e93a7a5255a6
Reviewed-on: http://gerrit.openafs.org/3452

src/afs/afs_server.c

index 3f64e9cd1a2036db3342f14276c0ead2cc2289f6..bd423dcc3a8030d76bec015dba243d172ccf15ab 100644 (file)
@@ -1262,7 +1262,7 @@ afsi_SetServerIPRank(struct srvAddr *sa, rx_ifaddr_t ifa)
     t = rx_ifaddr_dstaddress(ifa, &sout, sizeof(sout));
     if (t != 0) {
        sin = (struct sockaddr_in *)&sout;
-       myDstaddr = sin->sin_addr.s_addr;
+       myDstaddr = ntohl(sin->sin_addr.s_addr);
     } else {
        myDstaddr = 0;
     }