diff --git a/wpa_supplicant/ctrl_iface_zephyr.c b/wpa_supplicant/ctrl_iface_zephyr.c index 566381b41..5e17860de 100644 --- a/wpa_supplicant/ctrl_iface_zephyr.c +++ b/wpa_supplicant/ctrl_iface_zephyr.c @@ -135,6 +135,13 @@ static void wpa_supplicant_ctrl_iface_receive(int sock, void *eloop_ctx, os_free(buf); return; } + if (!res) { + eloop_unregister_sock(sock, EVENT_TYPE_READ); + wpa_printf(MSG_DEBUG, "ctrl_iface: Peer unexpectedly shut down " + "socket"); + os_free(buf); + return; + } if ((size_t) res > CTRL_IFACE_MAX_LEN) { wpa_printf(MSG_ERROR, "recvform(ctrl_iface): input truncated");