Skip to content

Commit 738cce9

Browse files
committed
[nrf fromlist] drivers: nrf_wifi: Fix the port authorization logic
For non-STA mode the vif level authorized flag is unused, simply allow all group traffic and for unicast traffic check respective peer status. Upstream PR #: 97183 Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
1 parent b3c501e commit 738cce9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/wifi/nrf_wifi/src/net_if.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,15 +454,20 @@ int nrf_wifi_if_send(const struct device *dev,
454454
goto drop;
455455
}
456456

457-
/* VIF or per-peer depending on RA */
458-
if (peer_id == MAX_PEERS) {
457+
/* Use authorized from vif_ctx_zep for STA mode, or per-peer for AP/GO */
458+
if (vif_ctx_zep->if_type == NRF_WIFI_IFTYPE_STATION) {
459459
authorized = vif_ctx_zep->authorized;
460-
} else {
460+
} else if (peer_id != MAX_PEERS) {
461461
authorized = sys_dev_ctx->tx_config.peers[peer_id].authorized;
462+
} else {
463+
/* non-STA modes always allow group frames */
464+
authorized = true;
462465
}
463466

464467
if ((vif_ctx_zep->if_carr_state != NRF_WIFI_FMAC_IF_CARR_STATE_ON) ||
465468
(!authorized && !is_eapol(pkt))) {
469+
LOG_DBG("%s: carrier state: %d, authorized: %d, is_eapol: %d",
470+
__func__, vif_ctx_zep->if_carr_state, authorized, is_eapol(pkt));
466471
ret = -EPERM;
467472
goto drop;
468473
}

0 commit comments

Comments
 (0)