Bug 1042873: Add the appropriate byte-order conversion to ChildDNSRecord::GetNextAddr r=mcmanus a=lmandel
authorByron Campen [:bwc] <docfaraday@gmail.com>
Wed, 23 Jul 2014 11:48:05 -0700
changeset 208166 fe0621be0dc3
parent 208165 ecdde13a0aaa
child 208167 f9b0de65c69d
push id3752
push userrjesup@wgate.com
push date2014-07-27 15:42 +0000
treeherdermozilla-beta@fe0621be0dc3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, lmandel
bugs1042873
milestone32.0
Bug 1042873: Add the appropriate byte-order conversion to ChildDNSRecord::GetNextAddr r=mcmanus a=lmandel
netwerk/dns/DNSRequestChild.cpp
--- a/netwerk/dns/DNSRequestChild.cpp
+++ b/netwerk/dns/DNSRequestChild.cpp
@@ -81,17 +81,17 @@ ChildDNSRecord::GetNextAddr(uint16_t por
 {
   if (mCurrent >= mLength) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   memcpy(addr, &mAddresses[mCurrent++], sizeof(NetAddr));
 
   // both Ipv4/6 use same bits for port, so safe to just use ipv4's field
-  addr->inet.port = port;
+  addr->inet.port = htons(port);
 
   return NS_OK;
 }
 
 // shamelessly copied from nsDNSRecord
 NS_IMETHODIMP
 ChildDNSRecord::GetScriptableNextAddr(uint16_t port, nsINetAddr **result)
 {