]> git.saurik.com Git - wxWidgets.git/commitdiff
byte ordering changed to network ordering
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 18 Apr 2004 16:30:50 +0000 (16:30 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 18 Apr 2004 16:30:50 +0000 (16:30 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26856 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/gsocket.c
src/msw/gsocket.c
src/unix/gsocket.c

index 9e3ba3079a4c3e75ef5dc34ed064c596d7ef37a8..e88784d0bcfa3bf291cf1776cd459e75b3a591a8 100644 (file)
@@ -1328,7 +1328,7 @@ GSocketError GAddress_INET_SetHostAddress(GAddress *address,
 
   CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
 
-  address->m_host = hostaddr ;
+  address->m_host = htonl(hostaddr) ;
 
   return GSOCK_NOERROR;
 }
@@ -1409,7 +1409,7 @@ unsigned long GAddress_INET_GetHostAddress(GAddress *address)
   assert(address != NULL); 
   CHECK_ADDRESS(address, INET, 0); 
 
-  return address->m_host;
+  return ntohl(address->m_host);
 }
 
 unsigned short GAddress_INET_GetPort(GAddress *address)
index 50121a09001fbcb889a87dbe02981e9157588216..86cfc7b913e4a03e8c2c96823f364e834fabc3b3 100644 (file)
@@ -1361,7 +1361,7 @@ GSocketError GAddress_INET_SetHostAddress(GAddress *address,
   CHECK_ADDRESS(address, INET);
 
   addr = &(((struct sockaddr_in *)address->m_addr)->sin_addr);
-  addr->s_addr = hostaddr;
+  addr->s_addr = htonl(hostaddr);;
 
   return GSOCK_NOERROR;
 }
@@ -1450,7 +1450,7 @@ unsigned long GAddress_INET_GetHostAddress(GAddress *address)
 
   addr = (struct sockaddr_in *)address->m_addr;
 
-  return addr->sin_addr.s_addr;
+  return ntohl(addr->sin_addr.s_addr);
 }
 
 unsigned short GAddress_INET_GetPort(GAddress *address)
index eae3b541aa3d404efccc3f04d591ff4335c5dada..3852eebd135f6902ef29edf07b2ccaf2afe084da 100644 (file)
@@ -1653,7 +1653,7 @@ GSocketError GAddress_INET_SetHostAddress(GAddress *address,
   CHECK_ADDRESS(address, INET);
 
   addr = &(((struct sockaddr_in *)address->m_addr)->sin_addr);
-  addr->s_addr = hostaddr;
+  addr->s_addr = htonl(hostaddr);
 
   return GSOCK_NOERROR;
 }
@@ -1744,7 +1744,7 @@ unsigned long GAddress_INET_GetHostAddress(GAddress *address)
 
   addr = (struct sockaddr_in *)address->m_addr;
 
-  return addr->sin_addr.s_addr;
+  return ntohl(addr->sin_addr.s_addr);
 }
 
 unsigned short GAddress_INET_GetPort(GAddress *address)