am a0eece26: am 6b858eb3: Keep IP forwarding enabled in tools mode.

* commit 'a0eece268a7dbd837f73c80ad97cbea81abebf11':
  Keep IP forwarding enabled in tools mode.
diff --git a/TetherController.cpp b/TetherController.cpp
index 8b8a294..2059cce 100644
--- a/TetherController.cpp
+++ b/TetherController.cpp
@@ -29,7 +29,7 @@
 
 #define LOG_TAG "TetherController"
 #include <cutils/log.h>
-
+#include <cutils/properties.h>
 
 #include "TetherController.h"
 
@@ -54,6 +54,14 @@
 int TetherController::setIpFwdEnabled(bool enable) {
 
     LOGD("Setting IP forward enable = %d", enable);
+
+    // In BP tools mode, do not disable IP forwarding
+    char bootmode[PROPERTY_VALUE_MAX] = {0};
+    property_get("ro.bootmode", bootmode, "unknown");
+    if ((enable == false) && (0 == strcmp("bp-tools", bootmode))) {
+        return 0;
+    }
+
     int fd = open("/proc/sys/net/ipv4/ip_forward", O_WRONLY);
     if (fd < 0) {
         LOGE("Failed to open ip_forward (%s)", strerror(errno));