summaryrefslogtreecommitdiffstats
path: root/contrib/wpa_supplicant
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/wpa_supplicant')
-rw-r--r--contrib/wpa_supplicant/FREEBSD-Xlist3
-rw-r--r--contrib/wpa_supplicant/common.h2
-rw-r--r--contrib/wpa_supplicant/wpa_ctrl.c7
-rw-r--r--contrib/wpa_supplicant/wpa_supplicant.c14
4 files changed, 20 insertions, 6 deletions
diff --git a/contrib/wpa_supplicant/FREEBSD-Xlist b/contrib/wpa_supplicant/FREEBSD-Xlist
index d2f1697..7770dc5 100644
--- a/contrib/wpa_supplicant/FREEBSD-Xlist
+++ b/contrib/wpa_supplicant/FREEBSD-Xlist
@@ -7,9 +7,6 @@ driver_bsd.c
driver_hostap.c
driver_ipw.c
driver_madwifi.c
-driver_ndis.c
-driver_ndis.h
-driver_ndis_.c
driver_ndiswrapper.c
driver_prism54.c
driver_test.c
diff --git a/contrib/wpa_supplicant/common.h b/contrib/wpa_supplicant/common.h
index 0f154e9..a075e51 100644
--- a/contrib/wpa_supplicant/common.h
+++ b/contrib/wpa_supplicant/common.h
@@ -1,3 +1,5 @@
+/* $FreeBSD$ */
+
#ifndef COMMON_H
#define COMMON_H
diff --git a/contrib/wpa_supplicant/wpa_ctrl.c b/contrib/wpa_supplicant/wpa_ctrl.c
index 631c628..3c79fc4 100644
--- a/contrib/wpa_supplicant/wpa_ctrl.c
+++ b/contrib/wpa_supplicant/wpa_ctrl.c
@@ -10,6 +10,8 @@
* license.
*
* See README and COPYING for more details.
+ *
+ * $FreeBSD$
*/
#include <stdlib.h>
@@ -88,7 +90,7 @@ struct wpa_ctrl * wpa_ctrl_open(const char *ctrl_path)
}
ctrl->local.sun_family = AF_UNIX;
- snprintf(ctrl->local.sun_path, sizeof(ctrl->local.sun_path),
+ snprintf(ctrl->local.sun_path, sizeof(ctrl->local.sun_path) - 1,
"/tmp/wpa_ctrl_%d-%d", getpid(), counter++);
if (bind(ctrl->s, (struct sockaddr *) &ctrl->local,
sizeof(ctrl->local)) < 0) {
@@ -98,8 +100,7 @@ struct wpa_ctrl * wpa_ctrl_open(const char *ctrl_path)
}
ctrl->dest.sun_family = AF_UNIX;
- snprintf(ctrl->dest.sun_path, sizeof(ctrl->dest.sun_path), "%s",
- ctrl_path);
+ strncpy(ctrl->dest.sun_path, ctrl_path, sizeof(ctrl->dest.sun_path) - 1);
if (connect(ctrl->s, (struct sockaddr *) &ctrl->dest,
sizeof(ctrl->dest)) < 0) {
close(ctrl->s);
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