From: Matthew Xie Date: Thu, 12 Jul 2012 23:42:07 +0000 (-0700) Subject: HACK: Need to startup dhcpd for non-system bluetooth stack X-Git-Tag: android-x86-7.1-r1~418 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1994410a3df367c7ce1083dc3f226c8ab68f4fdc;p=android-x86%2Fsystem-netd.git 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 @@ int TetherController::stopTethering() { 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 @@ int TetherController::startReverseTethering(const char* iface) { 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) {