diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c index f9d273c5946a..839c555b4a0b 100644 --- a/dp/wifi3.0/dp_rx.c +++ b/dp/wifi3.0/dp_rx.c @@ -2899,6 +2899,23 @@ done: continue; } + /* + * Drop non-EAPOL frames from unauthorized peer. + */ + if (qdf_likely(peer) && qdf_unlikely(!peer->authorize)) { + bool is_eapol = qdf_nbuf_is_ipv4_eapol_pkt(nbuf) || + qdf_nbuf_is_ipv4_wapi_pkt(nbuf); + + if (!is_eapol) { + DP_STATS_INC(soc, + rx.err.peer_unauth_rx_pkt_drop, + 1); + qdf_nbuf_free(nbuf); + nbuf = next; + continue; + } + } + if (soc->process_rx_status) dp_rx_cksum_offload(vdev->pdev, nbuf, rx_tlv_hdr); diff --git a/dp/wifi3.0/dp_stats.c b/dp/wifi3.0/dp_stats.c index 72d6faf33848..a8683bcfdb10 100644 --- a/dp/wifi3.0/dp_stats.c +++ b/dp/wifi3.0/dp_stats.c @@ -6560,6 +6560,8 @@ dp_print_soc_rx_stats(struct dp_soc *soc) soc->stats.rx.err.defrag_peer_uninit); DP_PRINT_STATS("Pkts delivered no peer = %d", soc->stats.rx.err.pkt_delivered_no_peer); + DP_PRINT_STATS("Pkts drop due to no peer auth :%d", + soc->stats.rx.err.peer_unauth_rx_pkt_drop); DP_PRINT_STATS("Invalid Pdev = %d", soc->stats.rx.err.invalid_pdev); DP_PRINT_STATS("Invalid Peer = %d", diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 2eea9b8258ea..303044ca52ec 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -1010,6 +1010,8 @@ struct dp_soc_stats { uint32_t bar_handle_fail_count; /* EAPOL drop count in intrabss scenario */ uint32_t intrabss_eapol_drop; + /* Non Eapol pkt drop cnt due to peer not authorized */ + uint32_t peer_unauth_rx_pkt_drop; } err; /* packet count per core - per ring */