Detach ctrl_iface monitor if the client socket is removed
[wpasupplicant] / hostapd / beacon.c
index 35c7028..8ccfa12 100644 (file)
@@ -25,7 +25,7 @@
 #include "wme.h"
 #include "beacon.h"
 #include "hw_features.h"
-#include "driver.h"
+#include "driver_i.h"
 #include "sta_info.h"
 #include "wps_hostapd.h"
 
@@ -298,8 +298,8 @@ void handle_probe_req(struct hostapd_data *hapd, struct ieee80211_mgmt *mgmt,
 
        pos = hostapd_eid_wpa(hapd, pos, epos - pos, sta);
 
-       /* Wi-Fi Wireless Multimedia Extensions */
-       pos = hostapd_eid_wme(hapd, pos);
+       /* Wi-Fi Alliance WMM */
+       pos = hostapd_eid_wmm(hapd, pos);
 
        pos = hostapd_eid_ht_capabilities_info(hapd, pos);
        pos = hostapd_eid_ht_operation(hapd, pos);
@@ -395,26 +395,25 @@ void ieee802_11_set_beacon(struct hostapd_data *hapd)
        tailpos = hostapd_eid_wpa(hapd, tailpos, tail + BEACON_TAIL_BUF_SIZE -
                                  tailpos, NULL);
 
-       /* Wi-Fi Wireless Multimedia Extensions */
-       tailpos = hostapd_eid_wme(hapd, tailpos);
+       /* Wi-Fi Alliance WMM */
+       tailpos = hostapd_eid_wmm(hapd, tailpos);
 
 #ifdef CONFIG_IEEE80211N
        if (hapd->iconf->ieee80211n) {
-               u8 *start;
-               start = tailpos;
+               u8 *ht_capab, *ht_oper;
+               ht_capab = tailpos;
                tailpos = hostapd_eid_ht_capabilities_info(hapd, tailpos);
-               if (hostapd_set_ht_capability(hapd->conf->iface, hapd,
-                                             start + 2)) {
+
+               ht_oper = tailpos;
+               tailpos = hostapd_eid_ht_operation(hapd, tailpos);
+
+               if (tailpos > ht_oper && ht_oper > ht_capab &&
+                   hostapd_set_ht_params(hapd->conf->iface, hapd,
+                                         ht_capab + 2, ht_capab[1],
+                                         ht_oper + 2, ht_oper[1])) {
                        wpa_printf(MSG_ERROR, "Could not set HT capabilities "
                                   "for kernel driver");
                }
-
-               start = tailpos;
-               tailpos = hostapd_eid_ht_operation(hapd, tailpos);
-               if (hostapd_set_ht_operation(hapd->conf->iface, hapd,
-                                            start + 2))
-                       wpa_printf(MSG_ERROR, "Could not set HT operation for "
-                                  "kernel driver");
        }
 #endif /* CONFIG_IEEE80211N */
 
@@ -435,6 +434,10 @@ void ieee802_11_set_beacon(struct hostapd_data *hapd)
        os_free(tail);
        os_free(head);
 
+       if (hostapd_set_dtim_period(hapd, hapd->conf->dtim_period))
+               wpa_printf(MSG_ERROR, "Could not set DTIM period for kernel "
+                          "driver");
+
        if (hostapd_set_cts_protect(hapd, cts_protection))
                wpa_printf(MSG_ERROR, "Failed to set CTS protect in kernel "
                           "driver");