Bug 977469 - When USB/Wifi Tethering are both enabled, disable one of them will also disable IP forwarding. r=vchang
authorDimi Lee <dlee@mozilla.com>
Thu, 27 Feb 2014 14:20:50 +0800
changeset 171378 48095b783018ef83571c2ac0505f75b126359a87
parent 171377 8af32e19462b1b73fed615ce79f8c2cb3ea364ba
child 171379 1157e9248f2958e7260294e4882816c5d25e0cf0
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersvchang
bugs977469
milestone30.0a1
Bug 977469 - When USB/Wifi Tethering are both enabled, disable one of them will also disable IP forwarding. r=vchang
dom/system/gonk/NetworkUtils.cpp
--- a/dom/system/gonk/NetworkUtils.cpp
+++ b/dom/system/gonk/NetworkUtils.cpp
@@ -17,17 +17,17 @@
 
 #include <android/log.h>
 #include <cutils/properties.h>
 #include <limits>
 #include "mozilla/dom/network/NetUtils.h"
 
 #define _DEBUG 0
 
-#define WARN(args...)   __android_log_print(ANDROID_LOG_WARN,  "NetworlUtils", ## args)
+#define WARN(args...)   __android_log_print(ANDROID_LOG_WARN,  "NetworkUtils", ## args)
 #define ERROR(args...)  __android_log_print(ANDROID_LOG_ERROR,  "NetworkUtils", ## args)
 
 #if _DEBUG
 #define DEBUG(args...)  __android_log_print(ANDROID_LOG_DEBUG, "NetworkUtils" , ## args)
 #else
 #define DEBUG(args...)
 #endif
 
@@ -60,17 +60,17 @@ static const uint32_t NETD_COMMAND_FAIL 
 static const uint32_t NETD_COMMAND_ERROR        = 500;
 // 6xx - Unsolicited broadcasts
 static const uint32_t NETD_COMMAND_UNSOLICITED  = 600;
 
 // Broadcast messages
 static const uint32_t NETD_COMMAND_INTERFACE_CHANGE     = 600;
 static const uint32_t NETD_COMMAND_BANDWIDTH_CONTROLLER = 601;
 
-static const char* INTERFACE_DELIMIT = "\0";
+static const char* INTERFACE_DELIMIT = ",";
 static const char* USB_CONFIG_DELIMIT = ",";
 static const char* NETD_MESSAGE_DELIMIT = " ";
 
 static const uint32_t BUF_SIZE = 1024;
 
 static uint32_t SDK_VERSION;
 
 struct IFProperties {
@@ -1021,17 +1021,16 @@ void NetworkUtils::onNetdMessage(NetdCom
 
   if (gCurrentCommand.callback) {
     char buf[BUF_SIZE];
     join(gReason, INTERFACE_DELIMIT, BUF_SIZE, buf);
 
     NetworkResultOptions result;
     result.mResultCode = code;
     result.mResultReason = NS_ConvertUTF8toUTF16(buf);
-    join(gReason, INTERFACE_DELIMIT, BUF_SIZE, buf);
     (*gCurrentCommand.callback)(gCurrentCommand.chain, isError(code), result);
     gReason.Clear();
   }
 
   // Handling pending commands if any.
   if (isComplete(code)) {
     nextNetdCommand();
   }