parent
dab5ebaa76
commit
c8321c3ca6
@ -0,0 +1,162 @@ |
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -1471,13 +1471,6 @@ static void handle_assoc_cb(struct hosta
|
||||
int new_assoc = 1;
|
||||
struct ieee80211_ht_capabilities ht_cap;
|
||||
|
||||
- if (!ok) {
|
||||
- hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
|
||||
- HOSTAPD_LEVEL_DEBUG,
|
||||
- "did not acknowledge association response");
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_resp) :
|
||||
sizeof(mgmt->u.assoc_resp))) {
|
||||
printf("handle_assoc_cb(reassoc=%d) - too short payload "
|
||||
@@ -1485,11 +1478,6 @@ static void handle_assoc_cb(struct hosta
|
||||
return;
|
||||
}
|
||||
|
||||
- if (reassoc)
|
||||
- status = le_to_host16(mgmt->u.reassoc_resp.status_code);
|
||||
- else
|
||||
- status = le_to_host16(mgmt->u.assoc_resp.status_code);
|
||||
-
|
||||
sta = ap_get_sta(hapd, mgmt->da);
|
||||
if (!sta) {
|
||||
printf("handle_assoc_cb: STA " MACSTR " not found\n",
|
||||
@@ -1497,6 +1485,19 @@ static void handle_assoc_cb(struct hosta
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (!ok) {
|
||||
+ hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
|
||||
+ HOSTAPD_LEVEL_DEBUG,
|
||||
+ "did not acknowledge association response");
|
||||
+ sta->flags &= ~WLAN_STA_ASSOC_REQ_OK;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (reassoc)
|
||||
+ status = le_to_host16(mgmt->u.reassoc_resp.status_code);
|
||||
+ else
|
||||
+ status = le_to_host16(mgmt->u.assoc_resp.status_code);
|
||||
+
|
||||
if (status != WLAN_STATUS_SUCCESS)
|
||||
goto fail;
|
||||
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -181,6 +181,7 @@ struct i802_bss {
|
||||
struct wpa_driver_nl80211_data *drv;
|
||||
struct i802_bss *next;
|
||||
int ifindex;
|
||||
+ u8 addr[ETH_ALEN];
|
||||
char ifname[IFNAMSIZ + 1];
|
||||
char brname[IFNAMSIZ];
|
||||
unsigned int beacon_set:1;
|
||||
@@ -191,7 +192,6 @@ struct i802_bss {
|
||||
struct wpa_driver_nl80211_data {
|
||||
struct nl80211_global *global;
|
||||
struct dl_list list;
|
||||
- u8 addr[ETH_ALEN];
|
||||
char phyname[32];
|
||||
void *ctx;
|
||||
int ifindex;
|
||||
@@ -2482,7 +2482,7 @@ wpa_driver_nl80211_finish_drv_init(struc
|
||||
return -1;
|
||||
|
||||
if (linux_get_ifhwaddr(drv->global->ioctl_sock, bss->ifname,
|
||||
- drv->addr))
|
||||
+ bss->addr))
|
||||
return -1;
|
||||
|
||||
if (nl80211_register_action_frames(drv) < 0) {
|
||||
@@ -5176,8 +5176,8 @@ static int wpa_driver_nl80211_hapd_send_
|
||||
pos = (u8 *) (hdr + 1);
|
||||
|
||||
if (qos) {
|
||||
- /* add an empty QoS header if needed */
|
||||
- pos[0] = 0;
|
||||
+ /* Set highest priority in QoS header */
|
||||
+ pos[0] = 7;
|
||||
pos[1] = 0;
|
||||
pos += 2;
|
||||
}
|
||||
@@ -6407,7 +6407,7 @@ static int i802_set_wds_sta(void *priv,
|
||||
if (!if_nametoindex(name)) {
|
||||
if (nl80211_create_iface(drv, name,
|
||||
NL80211_IFTYPE_AP_VLAN,
|
||||
- NULL, 1) < 0)
|
||||
+ bss->addr, 1) < 0)
|
||||
return -1;
|
||||
if (bridge_ifname &&
|
||||
linux_br_add_if(drv->global->ioctl_sock,
|
||||
@@ -6417,6 +6417,10 @@ static int i802_set_wds_sta(void *priv,
|
||||
linux_set_iface_flags(drv->global->ioctl_sock, name, 1);
|
||||
return i802_set_sta_vlan(priv, addr, name, 0);
|
||||
} else {
|
||||
+ if (bridge_ifname)
|
||||
+ linux_br_del_if(drv->global->ioctl_sock, bridge_ifname,
|
||||
+ name);
|
||||
+
|
||||
i802_set_sta_vlan(priv, addr, bss->ifname, 0);
|
||||
return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN,
|
||||
name);
|
||||
@@ -6625,7 +6629,7 @@ static int nl80211_addr_in_use(struct nl
|
||||
struct wpa_driver_nl80211_data *drv;
|
||||
dl_list_for_each(drv, &global->interfaces,
|
||||
struct wpa_driver_nl80211_data, list) {
|
||||
- if (os_memcmp(addr, drv->addr, ETH_ALEN) == 0)
|
||||
+ if (os_memcmp(addr, drv->first_bss.addr, ETH_ALEN) == 0)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -6640,9 +6644,9 @@ static int nl80211_p2p_interface_addr(st
|
||||
if (!drv->global)
|
||||
return -1;
|
||||
|
||||
- os_memcpy(new_addr, drv->addr, ETH_ALEN);
|
||||
+ os_memcpy(new_addr, drv->first_bss.addr, ETH_ALEN);
|
||||
for (idx = 0; idx < 64; idx++) {
|
||||
- new_addr[0] = drv->addr[0] | 0x02;
|
||||
+ new_addr[0] = drv->first_bss.addr[0] | 0x02;
|
||||
new_addr[0] ^= idx << 2;
|
||||
if (!nl80211_addr_in_use(drv->global, new_addr))
|
||||
break;
|
||||
@@ -6745,6 +6749,7 @@ static int wpa_driver_nl80211_if_add(voi
|
||||
os_free(new_bss);
|
||||
return -1;
|
||||
}
|
||||
+ memcpy(new_bss->addr, addr ? addr : if_addr, ETH_ALEN);
|
||||
os_strlcpy(new_bss->ifname, ifname, IFNAMSIZ);
|
||||
new_bss->ifindex = ifidx;
|
||||
new_bss->drv = drv;
|
||||
@@ -6775,7 +6780,12 @@ static int wpa_driver_nl80211_if_remove(
|
||||
if (ifindex <= 0)
|
||||
return -1;
|
||||
|
||||
+ nl80211_remove_iface(drv, ifindex);
|
||||
+
|
||||
#ifdef HOSTAPD
|
||||
+ if (type != WPA_IF_AP_BSS)
|
||||
+ return 0;
|
||||
+
|
||||
if (bss->added_if_into_bridge) {
|
||||
if (linux_br_del_if(drv->global->ioctl_sock, bss->brname,
|
||||
bss->ifname) < 0)
|
||||
@@ -6789,13 +6799,6 @@ static int wpa_driver_nl80211_if_remove(
|
||||
"bridge %s: %s",
|
||||
bss->brname, strerror(errno));
|
||||
}
|
||||
-#endif /* HOSTAPD */
|
||||
-
|
||||
- nl80211_remove_iface(drv, ifindex);
|
||||
-
|
||||
-#ifdef HOSTAPD
|
||||
- if (type != WPA_IF_AP_BSS)
|
||||
- return 0;
|
||||
|
||||
if (bss != &drv->first_bss) {
|
||||
struct i802_bss *tbss;
|
@ -0,0 +1,18 @@ |
||||
--- a/wpa_supplicant/ctrl_iface.c
|
||||
+++ b/wpa_supplicant/ctrl_iface.c
|
||||
@@ -685,6 +685,7 @@ static int wpa_supplicant_ctrl_iface_ibs
|
||||
#endif /* CONFIG_IBSS_RSN */
|
||||
|
||||
|
||||
+#ifdef IEEE8021X_EAPOL
|
||||
int wpa_supplicant_ctrl_iface_ctrl_rsp_handle(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid,
|
||||
const char *field,
|
||||
@@ -750,6 +751,7 @@ int wpa_supplicant_ctrl_iface_ctrl_rsp_h
|
||||
|
||||
return 0;
|
||||
}
|
||||
+#endif
|
||||
|
||||
|
||||
static int wpa_supplicant_ctrl_iface_ctrl_rsp(struct wpa_supplicant *wpa_s,
|
@ -1,15 +1,12 @@ |
||||
--- a/src/tls/x509v3.c
|
||||
+++ b/src/tls/x509v3.c
|
||||
@@ -1854,8 +1854,11 @@ int x509_certificate_chain_validate(stru
|
||||
@@ -1854,6 +1854,9 @@ int x509_certificate_chain_validate(stru
|
||||
if (chain_trusted)
|
||||
continue;
|
||||
|
||||
- if ((unsigned long) now.sec <
|
||||
+ if (
|
||||
+#ifndef NO_TIMESTAMP_CHECK
|
||||
+ (unsigned long) now.sec <
|
||||
(unsigned long) cert->not_before ||
|
||||
+#ifdef NO_TIMESTAMP_CHECK
|
||||
+ disable_time_checks = 1;
|
||||
+#endif
|
||||
(unsigned long) now.sec >
|
||||
(unsigned long) cert->not_after) {
|
||||
wpa_printf(MSG_INFO, "X509: Certificate not valid "
|
||||
if (!disable_time_checks &&
|
||||
((unsigned long) now.sec <
|
||||
(unsigned long) cert->not_before ||
|
||||
|
@ -1,21 +1,19 @@ |
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -5005,9 +5005,6 @@ static int wpa_driver_nl80211_set_mode(v
|
||||
/* Try to set the mode again while the interface is
|
||||
* down */
|
||||
@@ -5867,8 +5867,6 @@ static int wpa_driver_nl80211_set_mode(s
|
||||
ret = nl80211_set_mode(drv, drv->ifindex, nlmode);
|
||||
- if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname,
|
||||
- 1))
|
||||
- ret = -1;
|
||||
if (!ret)
|
||||
if (ret == -EACCES)
|
||||
break;
|
||||
} else
|
||||
@@ -5020,6 +5017,8 @@ static int wpa_driver_nl80211_set_mode(v
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Mode change succeeded while "
|
||||
- res = linux_set_iface_flags(drv->global->ioctl_sock,
|
||||
- bss->ifname, 1);
|
||||
if (res && !ret)
|
||||
ret = -1;
|
||||
else if (ret != -EBUSY)
|
||||
@@ -5884,6 +5882,7 @@ static int wpa_driver_nl80211_set_mode(s
|
||||
"interface is down");
|
||||
drv->nlmode = nlmode;
|
||||
+ if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname, 1))
|
||||
+ ret = -1;
|
||||
drv->ignore_if_down_event = 1;
|
||||
+ linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1);
|
||||
}
|
||||
|
||||
done:
|
||||
|
@ -1,29 +0,0 @@ |
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -5660,6 +5660,9 @@ static int i802_set_wds_sta(void *priv,
|
||||
linux_set_iface_flags(drv->ioctl_sock, name, 1);
|
||||
return i802_set_sta_vlan(priv, addr, name, 0);
|
||||
} else {
|
||||
+ if (bridge_ifname)
|
||||
+ linux_br_del_if(drv->ioctl_sock, bridge_ifname, name);
|
||||
+
|
||||
i802_set_sta_vlan(priv, addr, bss->ifname, 0);
|
||||
return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN,
|
||||
name);
|
||||
@@ -6021,14 +6024,14 @@ static int wpa_driver_nl80211_if_remove(
|
||||
return -1;
|
||||
|
||||
#ifdef HOSTAPD
|
||||
- if (bss->added_if_into_bridge) {
|
||||
+ if (type == WPA_IF_AP_BSS && bss->added_if_into_bridge) {
|
||||
if (linux_br_del_if(drv->ioctl_sock, bss->brname, bss->ifname)
|
||||
< 0)
|
||||
wpa_printf(MSG_INFO, "nl80211: Failed to remove "
|
||||
"interface %s from bridge %s: %s",
|
||||
bss->ifname, bss->brname, strerror(errno));
|
||||
}
|
||||
- if (bss->added_bridge) {
|
||||
+ if (type == WPA_IF_AP_BSS && bss->added_bridge) {
|
||||
if (linux_br_del(drv->ioctl_sock, bss->brname) < 0)
|
||||
wpa_printf(MSG_INFO, "nl80211: Failed to remove "
|
||||
"bridge %s: %s",
|
@ -1,6 +1,6 @@ |
||||
--- a/src/ap/wpa_auth.c
|
||||
+++ b/src/ap/wpa_auth.c
|
||||
@@ -1288,7 +1288,7 @@ static void wpa_send_eapol(struct wpa_au
|
||||
@@ -1330,7 +1330,7 @@ static void wpa_send_eapol(struct wpa_au
|
||||
keyidx, encr, 0);
|
||||
|
||||
ctr = pairwise ? sm->TimeoutCtr : sm->GTimeoutCtr;
|
@ -1,48 +0,0 @@ |
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -1629,13 +1629,6 @@ static void handle_assoc_cb(struct hosta
|
||||
int new_assoc = 1;
|
||||
struct ieee80211_ht_capabilities ht_cap;
|
||||
|
||||
- if (!ok) {
|
||||
- hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
|
||||
- HOSTAPD_LEVEL_DEBUG,
|
||||
- "did not acknowledge association response");
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_resp) :
|
||||
sizeof(mgmt->u.assoc_resp))) {
|
||||
printf("handle_assoc_cb(reassoc=%d) - too short payload "
|
||||
@@ -1643,11 +1636,6 @@ static void handle_assoc_cb(struct hosta
|
||||
return;
|
||||
}
|
||||
|
||||
- if (reassoc)
|
||||
- status = le_to_host16(mgmt->u.reassoc_resp.status_code);
|
||||
- else
|
||||
- status = le_to_host16(mgmt->u.assoc_resp.status_code);
|
||||
-
|
||||
sta = ap_get_sta(hapd, mgmt->da);
|
||||
if (!sta) {
|
||||
printf("handle_assoc_cb: STA " MACSTR " not found\n",
|
||||
@@ -1655,6 +1643,19 @@ static void handle_assoc_cb(struct hosta
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (!ok) {
|
||||
+ hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
|
||||
+ HOSTAPD_LEVEL_DEBUG,
|
||||
+ "did not acknowledge association response");
|
||||
+ sta->flags &= ~WLAN_STA_ASSOC_REQ_OK;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (reassoc)
|
||||
+ status = le_to_host16(mgmt->u.reassoc_resp.status_code);
|
||||
+ else
|
||||
+ status = le_to_host16(mgmt->u.assoc_resp.status_code);
|
||||
+
|
||||
if (status != WLAN_STATUS_SUCCESS)
|
||||
goto fail;
|
||||
|
@ -1,13 +0,0 @@ |
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -4413,8 +4413,8 @@ static int wpa_driver_nl80211_hapd_send_
|
||||
pos = (u8 *) (hdr + 1);
|
||||
|
||||
if (qos) {
|
||||
- /* add an empty QoS header if needed */
|
||||
- pos[0] = 0;
|
||||
+ /* Set highest priority in QoS header */
|
||||
+ pos[0] = 7;
|
||||
pos[1] = 0;
|
||||
pos += 2;
|
||||
}
|
@ -1,65 +0,0 @@ |
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -111,6 +111,7 @@ struct i802_bss {
|
||||
struct wpa_driver_nl80211_data *drv;
|
||||
struct i802_bss *next;
|
||||
int ifindex;
|
||||
+ u8 addr[ETH_ALEN];
|
||||
char ifname[IFNAMSIZ + 1];
|
||||
char brname[IFNAMSIZ];
|
||||
unsigned int beacon_set:1;
|
||||
@@ -121,7 +122,6 @@ struct i802_bss {
|
||||
struct wpa_driver_nl80211_data {
|
||||
struct nl80211_global *global;
|
||||
struct dl_list list;
|
||||
- u8 addr[ETH_ALEN];
|
||||
char phyname[32];
|
||||
void *ctx;
|
||||
struct netlink_data *netlink;
|
||||
@@ -2111,7 +2111,7 @@ wpa_driver_nl80211_finish_drv_init(struc
|
||||
if (wpa_driver_nl80211_capa(drv))
|
||||
return -1;
|
||||
|
||||
- if (linux_get_ifhwaddr(drv->ioctl_sock, bss->ifname, drv->addr))
|
||||
+ if (linux_get_ifhwaddr(drv->ioctl_sock, bss->ifname, bss->addr))
|
||||
return -1;
|
||||
|
||||
if (nl80211_register_action_frames(drv) < 0) {
|
||||
@@ -5650,7 +5650,7 @@ static int i802_set_wds_sta(void *priv,
|
||||
if (!if_nametoindex(name)) {
|
||||
if (nl80211_create_iface(drv, name,
|
||||
NL80211_IFTYPE_AP_VLAN,
|
||||
- NULL, 1) < 0)
|
||||
+ bss->addr, 1) < 0)
|
||||
return -1;
|
||||
if (bridge_ifname &&
|
||||
linux_br_add_if(drv->ioctl_sock, bridge_ifname,
|
||||
@@ -5878,7 +5878,7 @@ static int nl80211_addr_in_use(struct nl
|
||||
struct wpa_driver_nl80211_data *drv;
|
||||
dl_list_for_each(drv, &global->interfaces,
|
||||
struct wpa_driver_nl80211_data, list) {
|
||||
- if (os_memcmp(addr, drv->addr, ETH_ALEN) == 0)
|
||||
+ if (os_memcmp(addr, drv->first_bss.addr, ETH_ALEN) == 0)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -5893,9 +5893,9 @@ static int nl80211_p2p_interface_addr(st
|
||||
if (!drv->global)
|
||||
return -1;
|
||||
|
||||
- os_memcpy(new_addr, drv->addr, ETH_ALEN);
|
||||
+ os_memcpy(new_addr, drv->first_bss.addr, ETH_ALEN);
|
||||
for (idx = 0; idx < 64; idx++) {
|
||||
- new_addr[0] = drv->addr[0] | 0x02;
|
||||
+ new_addr[0] = drv->first_bss.addr[0] | 0x02;
|
||||
new_addr[0] ^= idx << 2;
|
||||
if (!nl80211_addr_in_use(drv->global, new_addr))
|
||||
break;
|
||||
@@ -5996,6 +5996,7 @@ static int wpa_driver_nl80211_if_add(voi
|
||||
os_free(new_bss);
|
||||
return -1;
|
||||
}
|
||||
+ memcpy(new_bss->addr, addr ? addr : if_addr, ETH_ALEN);
|
||||
os_strlcpy(new_bss->ifname, ifname, IFNAMSIZ);
|
||||
new_bss->ifindex = ifidx;
|
||||
new_bss->drv = drv;
|
Loading…
Reference in new issue