Bug 1018355 - IPv6 tethering failure. r=chulee, a=1.4+
authorVincent Chang <vchang@mozilla.com>
Thu, 05 Jun 2014 11:49:38 +0800
changeset 207938 3a5de06a61d895c4756ae6fb60c7a72572a7d2ff
parent 207937 81b2cfc3e15441ff815954cbbd7f26ca2a4153bc
child 207939 5c4f6b4bbd6b345f20e12e51c401173c3406408d
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschulee, 1
bugs1018355
milestone32.0a2
Bug 1018355 - IPv6 tethering failure. r=chulee, a=1.4+
dom/system/gonk/NetworkUtils.cpp
--- a/dom/system/gonk/NetworkUtils.cpp
+++ b/dom/system/gonk/NetworkUtils.cpp
@@ -1551,20 +1551,26 @@ bool NetworkUtils::setWifiOperationMode(
  */
 bool NetworkUtils::setWifiTethering(NetworkParams& aOptions)
 {
   bool enable = aOptions.mEnable;
   IFProperties interfaceProperties;
   getIFProperties(GET_CHAR(mExternalIfname), interfaceProperties);
 
   if (strcmp(interfaceProperties.dns1, "")) {
-    aOptions.mDns1 = NS_ConvertUTF8toUTF16(interfaceProperties.dns1);
+    int type = getIpType(interfaceProperties.dns1);
+    if (type != AF_INET6) {
+      aOptions.mDns1 = NS_ConvertUTF8toUTF16(interfaceProperties.dns1);
+    }
   }
   if (strcmp(interfaceProperties.dns2, "")) {
-    aOptions.mDns2 = NS_ConvertUTF8toUTF16(interfaceProperties.dns2);
+    int type = getIpType(interfaceProperties.dns2);
+    if (type != AF_INET6) {
+      aOptions.mDns2 = NS_ConvertUTF8toUTF16(interfaceProperties.dns2);
+    }
   }
   dumpParams(aOptions, "WIFI");
 
   if (enable) {
     DEBUG("Starting Wifi Tethering on %s <-> %s",
            GET_CHAR(mInternalIfname), GET_CHAR(mExternalIfname));
     RUN_CHAIN(aOptions, sWifiEnableChain, wifiTetheringFail)
   } else {
@@ -1577,20 +1583,26 @@ bool NetworkUtils::setWifiTethering(Netw
 
 bool NetworkUtils::setUSBTethering(NetworkParams& aOptions)
 {
   bool enable = aOptions.mEnable;
   IFProperties interfaceProperties;
   getIFProperties(GET_CHAR(mExternalIfname), interfaceProperties);
 
   if (strcmp(interfaceProperties.dns1, "")) {
-    aOptions.mDns1 = NS_ConvertUTF8toUTF16(interfaceProperties.dns1);
+    int type = getIpType(interfaceProperties.dns1);
+    if (type != AF_INET6) {
+      aOptions.mDns1 = NS_ConvertUTF8toUTF16(interfaceProperties.dns1);
+    }
   }
   if (strcmp(interfaceProperties.dns2, "")) {
-    aOptions.mDns2 = NS_ConvertUTF8toUTF16(interfaceProperties.dns2);
+    int type = getIpType(interfaceProperties.dns2);
+    if (type != AF_INET6) {
+      aOptions.mDns2 = NS_ConvertUTF8toUTF16(interfaceProperties.dns2);
+    }
   }
   dumpParams(aOptions, "USB");
 
   if (enable) {
     DEBUG("Starting USB Tethering on %s <-> %s",
            GET_CHAR(mInternalIfname), GET_CHAR(mExternalIfname));
     RUN_CHAIN(aOptions, sUSBEnableChain, usbTetheringFail)
   } else {