HACK: Need to startup dhcpd for non-system bluetooth stack
Add TODO comments to remove start/stopReverseTethering
Return error code with exit() in child process in startReverseTethering
when executing dhcpcd fails.
This is needed so we can get BT certification.
The cleanup is tracked in stopship b/6820232
Change-Id: I98a1c8aedfa042b1824de7d8c69f2600c9bfcf29
diff --git a/TetherController.cpp b/TetherController.cpp
index ceac0b9..2c48074 100644
--- a/TetherController.cpp
+++ b/TetherController.cpp
@@ -187,6 +187,8 @@
ALOGD("Tethering services stopped");
return 0;
}
+
+// TODO(BT) remove
int TetherController::startReverseTethering(const char* iface) {
if (mDhcpcdPid != 0) {
ALOGE("Reverse tethering already started");
@@ -228,13 +230,18 @@
ALOGE("startReverseTethering, execv failed (%s)", strerror(errno));
}
ALOGE("startReverseTethering, Should never get here!");
- return 0;
+ // TODO(BT) inform parent of the failure.
+ // Parent process need wait for child to report error status
+ // before it set mDhcpcdPid and return 0.
+ exit(-1);
} else {
mDhcpcdPid = pid;
ALOGD("Reverse Tethering running, pid:%d", pid);
}
return 0;
}
+
+// TODO(BT) remove
int TetherController::stopReverseTethering() {
if (mDhcpcdPid == 0) {