1 --- a/src/drivers/driver_nl80211.c
2 +++ b/src/drivers/driver_nl80211.c
3 @@ -4263,7 +4263,7 @@ static const u8 rfc1042_header[6] = { 0x
5 static int wpa_driver_nl80211_hapd_send_eapol(
6 void *priv, const u8 *addr, const u8 *data,
7 - size_t data_len, int encrypt, const u8 *own_addr)
8 + size_t data_len, int encrypt, const u8 *own_addr, u32 flags)
10 struct i802_bss *bss = priv;
11 struct wpa_driver_nl80211_data *drv = bss->drv;
12 @@ -4271,11 +4271,7 @@ static int wpa_driver_nl80211_hapd_send_
17 - int qos = sta->flags & WPA_STA_WMM;
21 + int qos = flags & WPA_STA_WMM;
23 len = sizeof(*hdr) + (qos ? 2 : 0) + sizeof(rfc1042_header) + 2 +
25 @@ -4291,26 +4287,22 @@ static int wpa_driver_nl80211_hapd_send_
26 hdr->frame_control |= host_to_le16(WLAN_FC_FROMDS);
28 hdr->frame_control |= host_to_le16(WLAN_FC_ISWEP);
29 -#if 0 /* To be enabled if qos determination is added above */
32 host_to_le16(WLAN_FC_STYPE_QOS_DATA << 4);
36 memcpy(hdr->IEEE80211_DA_FROMDS, addr, ETH_ALEN);
37 memcpy(hdr->IEEE80211_BSSID_FROMDS, own_addr, ETH_ALEN);
38 memcpy(hdr->IEEE80211_SA_FROMDS, own_addr, ETH_ALEN);
39 pos = (u8 *) (hdr + 1);
41 -#if 0 /* To be enabled if qos determination is added above */
43 /* add an empty QoS header if needed */
50 memcpy(pos, rfc1042_header, sizeof(rfc1042_header));
51 pos += sizeof(rfc1042_header);
52 --- a/src/drivers/driver.h
53 +++ b/src/drivers/driver.h
54 @@ -1396,7 +1396,7 @@ struct wpa_driver_ops {
56 int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
57 size_t data_len, int encrypt,
58 - const u8 *own_addr);
59 + const u8 *own_addr, u32 flags);
62 * sta_deauth - Deauthenticate a station (AP only)
63 --- a/src/drivers/driver_madwifi.c
64 +++ b/src/drivers/driver_madwifi.c
65 @@ -1097,7 +1097,7 @@ madwifi_wireless_event_init(struct madwi
68 madwifi_send_eapol(void *priv, const u8 *addr, const u8 *data, size_t data_len,
69 - int encrypt, const u8 *own_addr)
70 + int encrypt, const u8 *own_addr, u32 flags)
72 struct madwifi_driver_data *drv = priv;
73 unsigned char buf[3000];
74 --- a/src/drivers/driver_test.c
75 +++ b/src/drivers/driver_test.c
76 @@ -175,7 +175,7 @@ test_driver_get_cli(struct wpa_driver_te
78 static int test_driver_send_eapol(void *priv, const u8 *addr, const u8 *data,
79 size_t data_len, int encrypt,
81 + const u8 *own_addr, u32 flags)
83 struct test_driver_bss *dbss = priv;
84 struct wpa_driver_test_data *drv = dbss->drv;
85 --- a/src/drivers/driver_hostap.c
86 +++ b/src/drivers/driver_hostap.c
87 @@ -294,7 +294,8 @@ static int hostap_send_mlme(void *priv,
90 static int hostap_send_eapol(void *priv, const u8 *addr, const u8 *data,
91 - size_t data_len, int encrypt, const u8 *own_addr)
92 + size_t data_len, int encrypt, const u8 *own_addr,
95 struct hostap_driver_data *drv = priv;
96 struct ieee80211_hdr *hdr;
97 --- a/src/drivers/driver_atheros.c
98 +++ b/src/drivers/driver_atheros.c
99 @@ -1132,7 +1132,7 @@ atheros_wireless_event_init(struct ather
102 atheros_send_eapol(void *priv, const u8 *addr, const u8 *data, size_t data_len,
103 - int encrypt, const u8 *own_addr)
104 + int encrypt, const u8 *own_addr, u32 flags)
106 struct atheros_driver_data *drv = priv;
107 unsigned char buf[3000];
108 --- a/src/drivers/driver_bsd.c
109 +++ b/src/drivers/driver_bsd.c
110 @@ -516,7 +516,7 @@ no_ie:
113 bsd_send_eapol(void *priv, const u8 *addr, const u8 *data, size_t data_len,
114 - int encrypt, const u8 *own_addr)
115 + int encrypt, const u8 *own_addr, u32 flags)
117 struct bsd_driver_data *drv = priv;
119 --- a/src/ap/ap_drv_ops.h
120 +++ b/src/ap/ap_drv_ops.h
121 @@ -135,13 +135,14 @@ static inline int hostapd_drv_sta_remove
123 static inline int hostapd_drv_hapd_send_eapol(struct hostapd_data *hapd,
124 const u8 *addr, const u8 *data,
125 - size_t data_len, int encrypt)
126 + size_t data_len, int encrypt,
129 if (hapd->driver == NULL || hapd->driver->hapd_send_eapol == NULL)
131 return hapd->driver->hapd_send_eapol(hapd->drv_priv, addr, data,
134 + hapd->own_addr, flags);
137 static inline int hostapd_drv_read_sta_data(
138 --- a/src/ap/ieee802_1x.c
139 +++ b/src/ap/ieee802_1x.c
140 @@ -73,7 +73,7 @@ static void ieee802_1x_send(struct hosta
141 rsn_preauth_send(hapd, sta, buf, len);
143 hostapd_drv_hapd_send_eapol(hapd, sta->addr, buf, len,
145 + encrypt, sta->flags);
149 --- a/src/ap/wpa_auth_glue.c
150 +++ b/src/ap/wpa_auth_glue.c
151 @@ -243,8 +243,15 @@ static int hostapd_wpa_auth_send_eapol(v
154 struct hostapd_data *hapd = ctx;
155 + struct sta_info *sta;
158 + sta = ap_get_sta(hapd, addr);
160 + flags = sta->flags;
162 return hostapd_drv_hapd_send_eapol(hapd, addr, data, data_len,
168 --- a/wpa_supplicant/driver_i.h
169 +++ b/wpa_supplicant/driver_i.h
170 @@ -351,12 +351,12 @@ static inline int wpa_drv_sta_remove(str
171 static inline int wpa_drv_hapd_send_eapol(struct wpa_supplicant *wpa_s,
172 const u8 *addr, const u8 *data,
173 size_t data_len, int encrypt,
174 - const u8 *own_addr)
175 + const u8 *own_addr, u32 flags)
177 if (wpa_s->driver->hapd_send_eapol)
178 return wpa_s->driver->hapd_send_eapol(wpa_s->drv_priv, addr,
179 data, data_len, encrypt,
185 --- a/src/drivers/driver_wired.c
186 +++ b/src/drivers/driver_wired.c
187 @@ -314,7 +314,7 @@ static int wired_init_sockets(struct wpa
189 static int wired_send_eapol(void *priv, const u8 *addr,
190 const u8 *data, size_t data_len, int encrypt,
191 - const u8 *own_addr)
192 + const u8 *own_addr, u32 flags)
194 struct wpa_driver_wired_data *drv = priv;
195 struct ieee8023_hdr *hdr;