components/desktop/firefox/patches/firefox-45-wifi-scanner.patch
author Stacy Yeh <stacy.yeh@oracle.com>
Tue, 01 Mar 2016 12:56:53 -0800
changeset 5527 611b2d6efdfe
child 6919 7972aae0fb03
permissions -rw-r--r--
21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes 22757279 Update Thunderbird to version 38.5.0 22613259 thunderbird lightning extension is missing l10n after moved to userland 21133062 problem in TBIRD/MAILER

Convert variable int mac_as_int to char. 
Do not plan to send upstream.

diff --git a/netwerk/wifi/nsWifiScannerSolaris.cpp b/netwerk/wifi/nsWifiScannerSolaris.cpp
--- a/netwerk/wifi/nsWifiScannerSolaris.cpp
+++ b/netwerk/wifi/nsWifiScannerSolaris.cpp
@@ -28,47 +28,52 @@ static val_strength_t strength_vals[] = 
   { "good",      -68 },
   { "very good", -40 },
   { "excellent", -16 }
 };
 
 static nsWifiAccessPoint *
 do_parse_str(char *bssid_str, char *essid_str, char *strength)
 {
-  unsigned char mac_as_int[6] = { 0 };
+  unsigned int mac_as_int[6] = { 0 };
+  unsigned char mac_as_byte[6] = { 0 };
   sscanf(bssid_str, "%x:%x:%x:%x:%x:%x", &mac_as_int[0], &mac_as_int[1],
          &mac_as_int[2], &mac_as_int[3], &mac_as_int[4], &mac_as_int[5]);
 
+  for (uint32_t i = 0; i < 6; i++) {
+    mac_as_byte[i] = mac_as_int[i];
+  }
+
   int signal = 0;
   uint32_t strength_vals_count = sizeof(strength_vals) / sizeof (val_strength_t);
   for (uint32_t i = 0; i < strength_vals_count; i++) {
     if (!strncasecmp(strength, strength_vals[i].strength_name, DLADM_STRSIZE)) {
       signal = strength_vals[i].signal_value;
       break;
     }
   }
 
   nsWifiAccessPoint *ap = new nsWifiAccessPoint();
   if (ap) {
-    ap->setMac(mac_as_int);
+    ap->setMac(mac_as_byte);
     ap->setSignal(signal);
     ap->setSSID(essid_str, PL_strnlen(essid_str, DLADM_STRSIZE));
   }
   return ap;
 }
 
 static void
 do_dladm(nsCOMArray<nsWifiAccessPoint> &accessPoints)
 {
   GError *err = nullptr;
   char *sout = nullptr;
   char *serr = nullptr;
   int exit_status = 0;
   char * dladm_args[] = { "/usr/bin/pfexec", "/usr/sbin/dladm",
-                          "scan-wifi", "-p", "-o", "BSSID,ESSID,STRENGTH" };
+                          "scan-wifi", "-p", "-o", "BSSID,ESSID,STRENGTH", 0 };
 
   gboolean rv = g_spawn_sync("/", dladm_args, nullptr, (GSpawnFlags)0, nullptr,
                              nullptr, &sout, &serr, &exit_status, &err);
   if (rv && !exit_status) {
     char wlan[DLADM_SECTIONS][DLADM_STRSIZE+1];
     uint32_t section = 0;
     uint32_t sout_scan = 0;
     uint32_t wlan_put = 0;
--- a/dom/system/NetworkGeolocationProvider.js	2015-09-13 14:24:44.290458254 +0800
+++ b/dom/system/NetworkGeolocationProvider.js	2015-09-13 14:24:52.938673937 +0800
@@ -29,7 +29,7 @@
    data and xhr it to the location server.
 */
 
-let gLocationRequestTimeout = 5000;
+let gLocationRequestTimeout = 30000;
 
 let gWifiScanningEnabled = true;
 let gCellScanningEnabled = false;