355-eap_auth_disassoc.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. This patch causes STA mode interfaces to disassociate if transmission of assoc/auth
  2. critical packets failed.
  3. Signed-off-by: Felix Fietkau <[email protected]>
  4. --- a/ath/if_ath.c
  5. +++ b/ath/if_ath.c
  6. @@ -8332,6 +8332,14 @@ ath_tx_processq(struct ath_softc *sc, st
  7. #endif
  8. if (ts->ts_status & HAL_TXERR_XRETRY) {
  9. sc->sc_stats.ast_tx_xretries++;
  10. + if (SKB_CB(bf->bf_skb)->auth_pkt &&
  11. + (ni->ni_vap->iv_opmode == IEEE80211_M_STA)) {
  12. + struct ieee80211vap *vap = ni->ni_vap;
  13. +
  14. + /* if roaming is enabled, try reassociating, otherwise
  15. + * disassociate and go back to the scan state */
  16. + vap->iv_mgtsend.function(vap->iv_mgtsend.data);
  17. + }
  18. if (ni->ni_flags & IEEE80211_NODE_UAPSD_TRIG) {
  19. ni->ni_stats.ns_tx_eosplost++;
  20. DPRINTF(sc, ATH_DEBUG_UAPSD,
  21. --- a/net80211/ieee80211_linux.c
  22. +++ b/net80211/ieee80211_linux.c
  23. @@ -156,6 +156,7 @@ ieee80211_getmgtframe(u_int8_t **frm, u_
  24. if (off != 0)
  25. skb_reserve(skb, align - off);
  26. + SKB_CB(skb)->auth_pkt = 0;
  27. SKB_CB(skb)->ni = NULL;
  28. SKB_CB(skb)->flags = 0;
  29. SKB_CB(skb)->next = NULL;
  30. --- a/net80211/ieee80211_linux.h
  31. +++ b/net80211/ieee80211_linux.h
  32. @@ -393,6 +393,7 @@ typedef spinlock_t acl_lock_t;
  33. void (*next_destructor)(struct sk_buff *skb);
  34. #endif
  35. struct sk_buff *next; /* fast frame sk_buf chain */
  36. + u_int8_t auth_pkt;
  37. };
  38. --- a/net80211/ieee80211_output.c
  39. +++ b/net80211/ieee80211_output.c
  40. @@ -778,6 +778,8 @@ ieee80211_encap(struct ieee80211_node *n
  41. else
  42. hdrsize = sizeof(struct ieee80211_frame);
  43. + SKB_CB(skb)->auth_pkt = (eh.ether_type == __constant_htons(ETHERTYPE_PAE));
  44. +
  45. switch (vap->iv_opmode) {
  46. case IEEE80211_M_IBSS:
  47. case IEEE80211_M_AHDEMO:
  48. @@ -1622,6 +1624,7 @@ ieee80211_add_xr_param(u_int8_t *frm, st
  49. ie->param_len = frm - &ie->param_oui[0];
  50. return frm;
  51. }
  52. +
  53. #endif
  54. /*
  55. * Send a probe request frame with the specified ssid
  56. @@ -1886,6 +1889,7 @@ ieee80211_send_mgmt(struct ieee80211_nod
  57. sizeof(u_int16_t)+IEEE80211_CHALLENGE_LEN : 0));
  58. if (skb == NULL)
  59. senderr(ENOMEM, is_tx_nobuf);
  60. + SKB_CB(skb)->auth_pkt = 1;
  61. ((__le16 *)frm)[0] =
  62. (is_shared_key) ? htole16(IEEE80211_AUTH_ALG_SHARED)
  63. @@ -1960,6 +1964,7 @@ ieee80211_send_mgmt(struct ieee80211_nod
  64. vap->app_ie[IEEE80211_APPIE_FRAME_ASSOC_REQ].length);
  65. if (skb == NULL)
  66. senderr(ENOMEM, is_tx_nobuf);
  67. + SKB_CB(skb)->auth_pkt = 1;
  68. capinfo = 0;
  69. if (vap->iv_opmode == IEEE80211_M_IBSS)