Bug 718679 - ipToString in nsWifiWorker.js uses wrong byte order, r=mrbkap
authorMichael Wu <mwu@mozilla.com>
Wed, 18 Jan 2012 13:22:12 -0800
changeset 86048 5af4464163bdf4300ee07fa5e73827b365281859
parent 86047 d05a2f422e7d86f94c097b97230425207f948aeb
child 86049 6d074e0ec7c416a8b0ff9f5c19505434ee214416
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs718679
milestone12.0a1
Bug 718679 - ipToString in nsWifiWorker.js uses wrong byte order, r=mrbkap
dom/wifi/nsWifiWorker.js
--- a/dom/wifi/nsWifiWorker.js
+++ b/dom/wifi/nsWifiWorker.js
@@ -752,20 +752,20 @@ var WifiManager = (function() {
   manager.updateNetwork = function(config, callback) {
     manager.setNetworkConfiguration(config, callback);
   }
   manager.removeNetwork = function(netId, callback) {
     removeNetworkCommand(netId, callback);
   }
 
   function ipToString(n) {
-    return String((n & (0xff << 24)) >> 24) + "." +
-                 ((n & (0xff << 16)) >> 16) + "." +
-                 ((n & (0xff <<  8)) >>  8) + "." +
-                 ((n & (0xff <<  0)) >>  0);
+    return String((n >>  0) & 0xFF) + "." +
+                 ((n >>  8) & 0xFF) + "." +
+                 ((n >> 16) & 0xFF) + "." +
+                 ((n >> 24) & 0xFF);
   }
 
   manager.enableNetwork = function(netId, disableOthers, callback) {
     enableNetworkCommand(netId, disableOthers, callback);
   }
   manager.disableNetwork = function(netId, callback) {
     disableNetworkCommand(netId, callback);
   }