diff options
| author | Deepak Dhamdhere <ddhamdhe@qca.qualcomm.com> | 2015-07-15 00:23:20 -0700 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2015-07-22 17:02:37 +0530 |
| commit | 66a649d2cd61de2ed456f787d71a468ab62c1eb2 (patch) | |
| tree | 68e1c4b5d8d58448f217882192836a7df5a24c25 | |
| parent | 751405cbd75a4cf2e2780ea466301a22c934450c (diff) | |
qcacld-2.0: Avoid high QoS priority frames during EAP handshake
Access to WMM QoS access category is checked during transmit of each frame.
EAPOL frames are exempted for fast completion of security handshake
by allowing all frames to go unchecked in unauthenticated state. When
roaming with fast ping of voice priority, they should be downgraded
to best effort, but few frames slip through this window at voice
priority and get downgraded when EAPOL handshake is over.
Fix: Allow only EAPOL frames to go out without downgrading.
Added support to check for EAPOL and WAPI ethertypes.
CRs-Fixed: 876273
Change-Id: I859d9ff723b9f246ab358a482627064efb1bcc15
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_tx_rx.c | 102 |
1 files changed, 70 insertions, 32 deletions
diff --git a/CORE/HDD/src/wlan_hdd_tx_rx.c b/CORE/HDD/src/wlan_hdd_tx_rx.c index e3b2405799fe..b313f7fe822e 100644 --- a/CORE/HDD/src/wlan_hdd_tx_rx.c +++ b/CORE/HDD/src/wlan_hdd_tx_rx.c @@ -183,6 +183,66 @@ static void transport_thread(hdd_adapter_t *pAdapter) } #endif +/** + * wlan_hdd_is_eapol() - Function to check if frame is EAPOL or not + * @skb: skb data + * + * This function checks if the frame is an EAPOL frame or not + * + * Return: true (1) if packet is EAPOL + * + */ +static bool wlan_hdd_is_eapol(struct sk_buff *skb) +{ + uint16_t ether_type; + + if (!skb) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("skb is NULL")); + return false; + } + + ether_type = (uint16_t)(*(uint16_t *) + (skb->data + HDD_ETHERTYPE_802_1_X_FRAME_OFFSET)); + + if (ether_type == VOS_SWAP_U16(HDD_ETHERTYPE_802_1_X)) { + return true; + } else { + /* No error msg handled since this will happen often */ + return false; + } +} + +/** + * wlan_hdd_is_wai() - Check if frame is EAPOL or WAPI + * @skb: skb data + * + * This function checks if the frame is EAPOL or WAPI. + * single routine call will check for both types, thus avoiding + * data path performance penalty. + * + * Return: true (1) if packet is EAPOL or WAPI + * + */ +static bool wlan_hdd_is_eapol_or_wai(struct sk_buff *skb) +{ + uint16_t ether_type; + + if (!skb) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("skb is NULL")); + return false; + } + + ether_type = (uint16_t)(*(uint16_t *) + (skb->data + HDD_ETHERTYPE_802_1_X_FRAME_OFFSET)); + + if (ether_type == VOS_SWAP_U16(HDD_ETHERTYPE_802_1_X) || + ether_type == VOS_SWAP_U16(HDD_ETHERTYPE_WAI)) + return true; + + /* No error msg handled since this will happen often */ + return false; +} + /**============================================================================ @brief hdd_flush_tx_queues() - Utility function to flush the TX queues @@ -905,9 +965,16 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) hdd_wmm_acquire_access_required(pAdapter, ac); } - //Make sure we have access to this access category - if (((pAdapter->psbChanged & (1 << ac)) && likely(pAdapter->hddWmmStatus.wmmAcStatus[ac].wmmAcAccessAllowed)) || - (pHddStaCtx->conn_info.uIsAuthenticated == VOS_FALSE)) + /* + * Make sure we already have access to this access category + * or it is EAPOL or WAPI frame during initial authentication which + * can have artifically boosted higher qos priority. + */ + + if (((pAdapter->psbChanged & (1 << ac)) && + likely(pAdapter->hddWmmStatus.wmmAcStatus[ac].wmmAcAccessAllowed)) || + ((pHddStaCtx->conn_info.uIsAuthenticated == VOS_FALSE) && + wlan_hdd_is_eapol_or_wai(skb))) { granted = VOS_TRUE; } @@ -1896,35 +1963,6 @@ VOS_STATUS hdd_rx_packet_cbk(v_VOID_t *vosContext, #ifdef FEATURE_WLAN_DIAG_SUPPORT /** - * wlan_hdd_is_eapol() - Function to check if frame is EAPOL or not - * @skb: skb data - * - * This function checks if the frame is an EAPOL frame or not - * - * Return: true (1) if packet is EAPOL - * - */ -static bool wlan_hdd_is_eapol(struct sk_buff *skb) -{ - uint16_t ether_type=0; - - if (!skb) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("skb is NULL")); - return false; - } - - ether_type = (uint16_t)(*(uint16_t *) - (skb->data + HDD_EAPOL_ETHER_TYPE_OFFSET)); - - if (VOS_SWAP_U16(ether_type) == HDD_EAPOL_ETHER_TYPE) { - return true; - } else { - /* No error msg handled since this will happen often */ - return false; - } -} - -/** * wlan_hdd_get_eapol_params() - Function to extract EAPOL params * @skb: sbb data * @eapol_params: Pointer to hold the parsed EAPOL params |
