summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-09-20 16:17:28 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-09-20 16:17:28 -0700
commitc0ab77364b0d5bfcf1003b80cddec14f70825371 (patch)
treea7fa3e7605527eea373382ffa13258971604aaec
parent6d3a115c091adc1618b3d1e50a86951c3b35fa30 (diff)
parente0232039e0a59f7ef4fc67dad178387b2d5fffba (diff)
downloadhardware_libhardware_legacy-c0ab77364b0d5bfcf1003b80cddec14f70825371.zip
hardware_libhardware_legacy-c0ab77364b0d5bfcf1003b80cddec14f70825371.tar.gz
hardware_libhardware_legacy-c0ab77364b0d5bfcf1003b80cddec14f70825371.tar.bz2
am e0232039: Merge "Restore the ability to use ctrl_interface directory"
* commit 'e0232039e0a59f7ef4fc67dad178387b2d5fffba': Restore the ability to use ctrl_interface directory
-rw-r--r--wifi/wifi.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/wifi/wifi.c b/wifi/wifi.c
index 5a42e2d..cd9bf65 100644
--- a/wifi/wifi.c
+++ b/wifi/wifi.c
@@ -367,7 +367,19 @@ int update_ctrl_interface(const char *config_file) {
} else {
strcpy(ifc, CONTROL_IFACE_PATH);
}
- if ((sptr = strstr(pbuf, "ctrl_interface="))) {
+ /*
+ * if there is a "ctrl_interface=<value>" entry, re-write it ONLY if it is
+ * NOT a directory. The non-directory value option is an Android add-on
+ * that allows the control interface to be exchanged through an environment
+ * variable (initialized by the "init" program when it starts a service
+ * with a "socket" option).
+ *
+ * The <value> is deemed to be a directory if the "DIR=" form is used or
+ * the value begins with "/".
+ */
+ if ((sptr = strstr(pbuf, "ctrl_interface=")) &&
+ (!strstr(pbuf, "ctrl_interface=DIR=")) &&
+ (!strstr(pbuf, "ctrl_interface=/"))) {
char *iptr = sptr + strlen("ctrl_interface=");
int ilen = 0;
int mlen = strlen(ifc);