Indicate WPA_EVENT_TERMINATING event on primary interface.
Internal fabricated WPA_EVENT_TERMINATING events to restart supplicant should be sent on primary interface. Change-Id: I2d018e0707819614d9b092c6f3a812f04b5446ca
This commit is contained in:
parent
c7b6e3c857
commit
0ef9a33a47
1 changed files with 8 additions and 4 deletions
12
wifi/wifi.c
12
wifi/wifi.c
|
@ -720,26 +720,30 @@ int wifi_wait_on_socket(char *buf, size_t buflen)
|
|||
char *match, *match2;
|
||||
|
||||
if (monitor_conn == NULL) {
|
||||
return snprintf(buf, buflen, WPA_EVENT_TERMINATING " - connection closed");
|
||||
return snprintf(buf, buflen, "IFNAME=%s %s - connection closed",
|
||||
primary_iface, WPA_EVENT_TERMINATING);
|
||||
}
|
||||
|
||||
result = wifi_ctrl_recv(buf, &nread);
|
||||
|
||||
/* Terminate reception on exit socket */
|
||||
if (result == -2) {
|
||||
return snprintf(buf, buflen, WPA_EVENT_TERMINATING " - connection closed");
|
||||
return snprintf(buf, buflen, "IFNAME=%s %s - connection closed",
|
||||
primary_iface, WPA_EVENT_TERMINATING);
|
||||
}
|
||||
|
||||
if (result < 0) {
|
||||
ALOGD("wifi_ctrl_recv failed: %s\n", strerror(errno));
|
||||
return snprintf(buf, buflen, WPA_EVENT_TERMINATING " - recv error");
|
||||
return snprintf(buf, buflen, "IFNAME=%s %s - recv error",
|
||||
primary_iface, WPA_EVENT_TERMINATING);
|
||||
}
|
||||
buf[nread] = '\0';
|
||||
/* Check for EOF on the socket */
|
||||
if (result == 0 && nread == 0) {
|
||||
/* Fabricate an event to pass up */
|
||||
ALOGD("Received EOF on supplicant socket\n");
|
||||
return snprintf(buf, buflen, WPA_EVENT_TERMINATING " - signal 0 received");
|
||||
return snprintf(buf, buflen, "IFNAME=%s %s - signal 0 received",
|
||||
primary_iface, WPA_EVENT_TERMINATING);
|
||||
}
|
||||
/*
|
||||
* Events strings are in the format
|
||||
|
|
Loading…
Reference in a new issue