From: Antoine Verheijen Date: Wed, 1 Dec 2010 18:54:23 +0000 (-0700) Subject: Darwin: Assign correct value to myDstaddr in afsi_SetServerIPRank() X-Git-Tag: upstream/1.8.0_pre1^2~4424 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=2822416059fe192dc7e3c261b1e93510f2f10f3e;p=packages%2Fo%2Fopenafs.git Darwin: Assign correct value to myDstaddr in afsi_SetServerIPRank() 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. Change-Id: I3078da1efb94f87f84dbe357f3272d908818256b Reviewed-on: http://gerrit.openafs.org/3402 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c index 086ab4d93..001704979 100644 --- a/src/afs/afs_server.c +++ b/src/afs/afs_server.c @@ -1270,7 +1270,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; }