1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-28 11:57:28 +00:00

terminate when all interfaces have been removed; since we do not

do interface discovery there's no point in sticking around

MFC after:	3 days
This commit is contained in:
Sam Leffler 2005-07-29 05:58:35 +00:00
parent e45a56744b
commit 87a1a1a2eb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=148504

View File

@ -10,6 +10,8 @@
* license.
*
* See README and COPYING for more details.
*
* $FreeBSD$
*/
#include <stdlib.h>
@ -871,6 +873,15 @@ static void wpa_supplicant_associnfo(struct wpa_supplicant *wpa_s,
}
static int any_interfaces(struct wpa_supplicant *head)
{
struct wpa_supplicant *wpa_s;
for (wpa_s = head; wpa_s != NULL; wpa_s = wpa_s->next)
if (!wpa_s->interface_removed)
return 1;
return 0;
}
void wpa_supplicant_event(struct wpa_supplicant *wpa_s, wpa_event_type event,
union wpa_event_data *data)
@ -1001,6 +1012,9 @@ void wpa_supplicant_event(struct wpa_supplicant *wpa_s, wpa_event_type event,
wpa_supplicant_mark_disassoc(wpa_s);
l2_packet_deinit(wpa_s->l2);
wpa_s->l2 = NULL;
/* check if last interface */
if (!any_interfaces(wpa_s->head))
eloop_terminate();
break;
}
break;