100-pending_work.patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. --- a/src/ap/ieee802_11.c
  2. +++ b/src/ap/ieee802_11.c
  3. @@ -1488,13 +1488,6 @@ static void handle_assoc_cb(struct hosta
  4. int new_assoc = 1;
  5. struct ieee80211_ht_capabilities ht_cap;
  6. - if (!ok) {
  7. - hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
  8. - HOSTAPD_LEVEL_DEBUG,
  9. - "did not acknowledge association response");
  10. - return;
  11. - }
  12. -
  13. if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_resp) :
  14. sizeof(mgmt->u.assoc_resp))) {
  15. printf("handle_assoc_cb(reassoc=%d) - too short payload "
  16. @@ -1502,11 +1495,6 @@ static void handle_assoc_cb(struct hosta
  17. return;
  18. }
  19. - if (reassoc)
  20. - status = le_to_host16(mgmt->u.reassoc_resp.status_code);
  21. - else
  22. - status = le_to_host16(mgmt->u.assoc_resp.status_code);
  23. -
  24. sta = ap_get_sta(hapd, mgmt->da);
  25. if (!sta) {
  26. printf("handle_assoc_cb: STA " MACSTR " not found\n",
  27. @@ -1514,6 +1502,19 @@ static void handle_assoc_cb(struct hosta
  28. return;
  29. }
  30. + if (!ok) {
  31. + hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
  32. + HOSTAPD_LEVEL_DEBUG,
  33. + "did not acknowledge association response");
  34. + sta->flags &= ~WLAN_STA_ASSOC_REQ_OK;
  35. + return;
  36. + }
  37. +
  38. + if (reassoc)
  39. + status = le_to_host16(mgmt->u.reassoc_resp.status_code);
  40. + else
  41. + status = le_to_host16(mgmt->u.assoc_resp.status_code);
  42. +
  43. if (status != WLAN_STATUS_SUCCESS)
  44. goto fail;
  45. @@ -1812,6 +1813,9 @@ void ieee802_11_rx_from_unknown(struct h
  46. sta = ap_get_sta(hapd, src);
  47. if (sta && (sta->flags & WLAN_STA_ASSOC)) {
  48. + if (!hapd->conf->wds_sta)
  49. + return;
  50. +
  51. if (wds && !(sta->flags & WLAN_STA_WDS)) {
  52. wpa_printf(MSG_DEBUG, "Enable 4-address WDS mode for "
  53. "STA " MACSTR " (aid %u)",
  54. --- a/src/drivers/driver_nl80211.c
  55. +++ b/src/drivers/driver_nl80211.c
  56. @@ -2601,10 +2601,10 @@ static int wpa_driver_nl80211_capa(struc
  57. drv->data_tx_status = info.data_tx_status;
  58. /*
  59. - * If poll command is supported mac80211 is new enough to
  60. - * have everything we need to not need monitor interfaces.
  61. + * If poll command and tx status are supported, mac80211 is new enough
  62. + * to have everything we need to not need monitor interfaces.
  63. */
  64. - drv->use_monitor = !info.poll_command_supported;
  65. + drv->use_monitor = !info.poll_command_supported || !info.data_tx_status;
  66. if (drv->device_ap_sme && drv->use_monitor) {
  67. /*
  68. @@ -6286,8 +6286,8 @@ static int wpa_driver_nl80211_hapd_send_
  69. pos = (u8 *) (hdr + 1);
  70. if (qos) {
  71. - /* add an empty QoS header if needed */
  72. - pos[0] = 0;
  73. + /* Set highest priority in QoS header */
  74. + pos[0] = 7;
  75. pos[1] = 0;
  76. pos += 2;
  77. }
  78. @@ -7564,6 +7564,10 @@ static int i802_set_wds_sta(void *priv,
  79. linux_set_iface_flags(drv->global->ioctl_sock, name, 1);
  80. return i802_set_sta_vlan(priv, addr, name, 0);
  81. } else {
  82. + if (bridge_ifname)
  83. + linux_br_del_if(drv->global->ioctl_sock, bridge_ifname,
  84. + name);
  85. +
  86. i802_set_sta_vlan(priv, addr, bss->ifname, 0);
  87. return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN,
  88. name);
  89. @@ -7931,7 +7935,12 @@ static int wpa_driver_nl80211_if_remove(
  90. if (ifindex <= 0)
  91. return -1;
  92. + nl80211_remove_iface(drv, ifindex);
  93. +
  94. #ifdef HOSTAPD
  95. + if (type != WPA_IF_AP_BSS)
  96. + return 0;
  97. +
  98. if (bss->added_if_into_bridge) {
  99. if (linux_br_del_if(drv->global->ioctl_sock, bss->brname,
  100. bss->ifname) < 0)
  101. @@ -7945,13 +7954,6 @@ static int wpa_driver_nl80211_if_remove(
  102. "bridge %s: %s",
  103. bss->brname, strerror(errno));
  104. }
  105. -#endif /* HOSTAPD */
  106. -
  107. - nl80211_remove_iface(drv, ifindex);
  108. -
  109. -#ifdef HOSTAPD
  110. - if (type != WPA_IF_AP_BSS)
  111. - return 0;
  112. if (bss != &drv->first_bss) {
  113. struct i802_bss *tbss;