qcacmn: Enable Peer authorization support in RX path

In security mode, allow only EAPOL frames in receive path
when peer is not authorized. This feature is enabled per VAP
based on vdev flag and will be applicable for all peers in that
VAP

Change-Id: Ic5dea09c2083f31e8cd301a0cdc3565f247b735c
此提交包含在:
Mainak Sen
2020-10-29 18:02:02 +05:30
提交者 snandini
父節點 6676daab7d
當前提交 37a91751be
共有 5 個檔案被更改,包括 40 行新增0 行删除

查看文件

@@ -2630,6 +2630,28 @@ done:
if (qdf_likely(peer)) {
vdev = peer->vdev;
/*
* In encryption mode, all data packets except
* EAPOL frames should be dropped when peer is not
* authenticated. Thie feature is enabled for all peers
* under this vdev when peer_authorize flag is set.
*/
if (qdf_unlikely(vdev->peer_authorize)) {
if (qdf_unlikely(vdev->sec_type != cdp_sec_type_none)) {
/*
* Allow only EAPOL frames
*/
if (qdf_unlikely(!peer->authorize &&
!qdf_nbuf_is_ipv4_eapol_pkt(nbuf))) {
qdf_nbuf_free(nbuf);
nbuf = next;
DP_STATS_INC(soc, rx.err.peer_unauth_rx_pkt_drop, 1);
continue;
}
}
}
} else {
nbuf->next = NULL;
dp_rx_deliver_to_stack_no_peer(soc, nbuf);