summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2005-07-29 05:58:35 +0000
committersam <sam@FreeBSD.org>2005-07-29 05:58:35 +0000
commitb9e6c6d781096f754bb65e993c260008f40e460a (patch)
tree656e69d0aceb43cc3107866e2272e91b6c3b2d26 /contrib
parent2626cf3b71f259ad793fdb031df219c6e2f1c971 (diff)
downloadFreeBSD-src-b9e6c6d781096f754bb65e993c260008f40e460a.zip
FreeBSD-src-b9e6c6d781096f754bb65e993c260008f40e460a.tar.gz
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
Diffstat (limited to 'contrib')
-rw-r--r--contrib/wpa_supplicant/wpa_supplicant.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/wpa_supplicant/wpa_supplicant.c b/contrib/wpa_supplicant/wpa_supplicant.c
index 0c57143..a1524ab 100644
--- a/contrib/wpa_supplicant/wpa_supplicant.c
+++ b/contrib/wpa_supplicant/wpa_supplicant.c
@@ -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;
OpenPOWER on IntegriCloud