wpa_supplicant/hostapd: Added some missing patches.
authorJan Lentfer <Jan.Lentfer@web.de>
Fri, 5 Feb 2010 06:32:02 +0000 (07:32 +0100)
committerJan Lentfer <Jan.Lentfer@web.de>
Sun, 14 Feb 2010 10:11:06 +0000 (11:11 +0100)
contrib/hostapd/src/utils/os_unix.c
contrib/wpa_supplicant/src/utils/os_unix.c
contrib/wpa_supplicant/wpa_supplicant/events.c
usr.sbin/802_11/wpa_supplicant/Makefile

index bc2fc40..ea46094 100644 (file)
@@ -228,7 +228,7 @@ int os_setenv(const char *name, const char *value, int overwrite)
 int os_unsetenv(const char *name)
 {
 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || \
-    defined(__OpenBSD__)
+    defined(__OpenBSD__) || defined(__DragonFly__)
        unsetenv(name);
        return 0;
 #else
index bc2fc40..ea46094 100644 (file)
@@ -228,7 +228,7 @@ int os_setenv(const char *name, const char *value, int overwrite)
 int os_unsetenv(const char *name)
 {
 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || \
-    defined(__OpenBSD__)
+    defined(__OpenBSD__) || defined(__DragonFly__)
        unsetenv(name);
        return 0;
 #else
index 39efedd..63002a4 100644 (file)
@@ -1060,6 +1060,18 @@ wpa_supplicant_event_michael_mic_failure(struct wpa_supplicant *wpa_s,
 }
 
 
+#ifdef CONFIG_TERMINATE_ONLASTIF
+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;
+}
+#endif /* CONFIG_TERMINATE_ONLASTIF */
+
 static void
 wpa_supplicant_event_interface_status(struct wpa_supplicant *wpa_s,
                                      union wpa_event_data *data)
@@ -1084,6 +1096,11 @@ wpa_supplicant_event_interface_status(struct wpa_supplicant *wpa_s,
                wpa_supplicant_mark_disassoc(wpa_s);
                l2_packet_deinit(wpa_s->l2);
                wpa_s->l2 = NULL;
+#ifdef CONFIG_TERMINATE_ONLASTIF
+               /* check if last interface */
+               if (!any_interfaces(wpa_s->global->ifaces))
+                       eloop_terminate();
+#endif /* CONFIG_TERMINATE_ONLASTIF */
                break;
        }
 }
index e32d5a7..30534f3 100644 (file)
@@ -17,7 +17,6 @@ SRCS= aes.c aes_wrap.c blacklist.c common.c config.c ctrl_iface.c \
        driver_ndis.c Packet32.c \
        driver_wired.c \
        driver_dragonfly.c os_unix.c
-#SRCS+=        driver_wired.c.patch events.c.patch
 
 MAN=   wpa_supplicant.8 wpa_supplicant.conf.5