From e1334b3595c49b132aae01d31097d37fd6b4fe98 Mon Sep 17 00:00:00 2001 From: Gurumoorthi Gnanasambandhan Date: Fri, 7 Dec 2018 12:14:17 +0530 Subject: [PATCH] qcacmn: Accept EAPOL packets in uncrypted error case rx unencrypted eapol frames are dropped with dynamic WEP on de-tunnel mode. Accept EAPOL packets alone in uncrypted path. Change-Id: Ie576211c3d408fd7e319fba05c9d1badaa4b4676 --- dp/wifi3.0/dp_rx_err.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/dp/wifi3.0/dp_rx_err.c b/dp/wifi3.0/dp_rx_err.c index 6aeb44886c9f..eb9f65b67519 100644 --- a/dp/wifi3.0/dp_rx_err.c +++ b/dp/wifi3.0/dp_rx_err.c @@ -796,7 +796,7 @@ dp_rx_process_err_unencrypted(struct dp_soc *soc, qdf_nbuf_t nbuf, uint16_t msdu_len; struct dp_vdev *vdev; struct ether_header *eh; - bool isBroadcast; + bool is_broadcast; /* * Check if DMA completed -- msdu_done is the last bit @@ -849,6 +849,9 @@ dp_rx_process_err_unencrypted(struct dp_soc *soc, qdf_nbuf_t nbuf, */ qdf_nbuf_pull_head(nbuf, l2_hdr_offset + RX_PKT_TLVS_LEN); + if (vdev->rx_decap_type == htt_cmn_pkt_type_raw) + goto process_mesh; + /* * WAPI cert AP sends rekey frames as unencrypted. * Thus RXDMA will report unencrypted frame error. @@ -857,17 +860,18 @@ dp_rx_process_err_unencrypted(struct dp_soc *soc, qdf_nbuf_t nbuf, */ if (qdf_nbuf_is_ipv4_wapi_pkt(nbuf)) { qdf_nbuf_cb_update_peer_local_id(nbuf, peer->local_id); - - if (qdf_likely(vdev->osif_rx)) { - DP_STATS_INC(peer, rx.to_stack.num, 1); - vdev->osif_rx(vdev->osif_vdev, nbuf); - } else { - qdf_nbuf_free(nbuf); - DP_STATS_INC(soc, rx.err.invalid_vdev, 1); - } - - return; + goto process_rx; } + /* + * In dynamic WEP case rekey frames are not encrypted + * similar to WAPI. Allow EAPOL when 8021+wep is enabled and + * key install is already done + */ + if ((vdev->sec_type == cdp_sec_type_wep104) && + (qdf_nbuf_is_ipv4_eapol_pkt(nbuf))) + goto process_rx; + +process_mesh: /* Drop & free packet if mesh mode not enabled */ if (!vdev->mesh_vdev) { @@ -884,18 +888,18 @@ dp_rx_process_err_unencrypted(struct dp_soc *soc, qdf_nbuf_t nbuf, qdf_nbuf_free(nbuf); return; - } dp_rx_fill_mesh_stats(vdev, nbuf, rx_tlv_hdr, peer); +process_rx: if (qdf_unlikely(hal_rx_msdu_end_da_is_mcbc_get(rx_tlv_hdr) && (vdev->rx_decap_type == htt_cmn_pkt_type_ethernet))) { eh = (struct ether_header *)qdf_nbuf_data(nbuf); - isBroadcast = (IEEE80211_IS_BROADCAST + is_broadcast = (IEEE80211_IS_BROADCAST (eh->ether_dhost)) ? 1 : 0 ; DP_STATS_INC_PKT(peer, rx.multicast, 1, qdf_nbuf_len(nbuf)); - if (isBroadcast) { + if (is_broadcast) { DP_STATS_INC_PKT(peer, rx.bcast, 1, qdf_nbuf_len(nbuf)); }