From 4f41ea7fbf836229ba8b8fbcaffabad5de590bb7 Mon Sep 17 00:00:00 2001 From: Rajagopal <148243701+Raju-krish@users.noreply.github.com> Date: Thu, 9 Jul 2026 22:14:47 +1000 Subject: [PATCH 1/4] BCOMB-3480: Client connectivity drop due to Gateway blocking Unencrypted frames (#1245) Reason for change : DHCP discover gets dropped because STA sends it without encryption. Proposed Fix : Disassociate the client if it doesn't have IP Test Proceedure : 1) If STA sends unprotected frame without having IP should disassociate. Priority: P0 Risks: Low Signed-off-by: Rajagopalaswamy M --- source/stats/wifi_monitor.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/source/stats/wifi_monitor.c b/source/stats/wifi_monitor.c index 173e876e8..7109c5215 100644 --- a/source/stats/wifi_monitor.c +++ b/source/stats/wifi_monitor.c @@ -28,6 +28,7 @@ #include #include "collection.h" #include "wifi_hal.h" +#include "wifi_hal_rdk_framework.h" #include "wifi_mgr.h" #include "wifi_stubs.h" #include "wifi_util.h" @@ -3992,6 +3993,40 @@ int device_disassociated(int ap_index, char *src_mac, char *dest_mac, int type, return 0; } +int device_frame_drop_unencrypted(int ap_index, char *src_mac, unsigned short ether_type) +{ + mac_address_t sta_mac; + char cli_ip_str[IP_STR_LEN] = { 0 }; + char cli_interface_str[IFNAMSIZ] = { 0 }; + const int reason = WLAN_REASON_PREV_AUTH_NOT_VALID; + + if (src_mac == NULL) { + wifi_util_dbg_print(WIFI_MON, "%s:%d input mac is NULL for ap_index:%d\n", + __func__, __LINE__, ap_index); + return -1; + } + + str_to_mac_bytes(src_mac, sta_mac); + + /* Only force a disassoc when the STA has no IPv4 yet, where the + * unprotected frames are blocking DHCP from ever succeeding. */ + if (csi_getClientIpAddress(src_mac, cli_ip_str, cli_interface_str, 1) == 0 && + cli_ip_str[0] != '\0') { + wifi_util_info_print(WIFI_MON, + "%s:%d: [FC_WEP] client[%s] has IPv4 %s on %s - no action\n", + __func__, __LINE__, src_mac, cli_ip_str, cli_interface_str); + return 0; + } + + wifi_util_info_print(WIFI_MON, + "%s:%d: [FC_WEP] client[%s] on ap:%d (ethertype:0x%04x) has no IPv4 - disassociating\n", + __func__, __LINE__, src_mac, ap_index, ether_type); + + wifi_hal_disassoc(ap_index, reason, sta_mac); + + return 0; +} + void notify_radius_endpoint_change(radius_fallback_and_failover_data_t *radius_data) { wifi_vap_security_t *vapSecurity = (wifi_vap_security_t *)Get_wifi_object_bss_security_parameter(radius_data->apIndex); @@ -4755,6 +4790,7 @@ int init_wifi_monitor() wifi_vapstatus_callback_register(vapstatus_callback); wifi_hal_apDeAuthEvent_callback_register(device_deauthenticated); wifi_hal_apDisassociatedDevice_callback_register(device_disassociated); + wifi_hal_apFrameDropUnencrypted_callback_register(device_frame_drop_unencrypted); wifi_hal_ap_max_client_rejection_callback_register(device_max_client_rejection); wifi_hal_radius_eap_failure_callback_register(radius_eap_failure_callback); wifi_hal_radiusFallback_failover_callback_register(radius_fallback_and_failover_callback); From 22e3b03c11d30666e79992b13296cc57ae8e3903 Mon Sep 17 00:00:00 2001 From: Rajagopalaswamy M Date: Wed, 15 Jul 2026 11:37:54 +0000 Subject: [PATCH 2/4] Route unprotected-frame disassoc through OneWifi ctrl queue --- include/wifi_events.h | 1 + source/core/wifi_ctrl_queue_handlers.c | 24 ++++++++++++++++++++++++ source/core/wifi_events.c | 1 + source/stats/wifi_monitor.c | 11 +++++++++-- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/include/wifi_events.h b/include/wifi_events.h index 16c7ea5d7..54c507b94 100644 --- a/include/wifi_events.h +++ b/include/wifi_events.h @@ -135,6 +135,7 @@ typedef enum { wifi_event_type_dfs_atbootup_rfc, wifi_event_type_command_kickmac, wifi_event_type_command_kick_assoc_devices, + wifi_event_type_command_frame_drop_unenc, wifi_event_type_command_wps, wifi_event_type_command_wps_pin, wifi_event_type_command_wps_cancel, diff --git a/source/core/wifi_ctrl_queue_handlers.c b/source/core/wifi_ctrl_queue_handlers.c index 72798327a..eea52f3fa 100644 --- a/source/core/wifi_ctrl_queue_handlers.c +++ b/source/core/wifi_ctrl_queue_handlers.c @@ -1521,6 +1521,26 @@ void kick_all_macs(int vap_index, int timeout, rdk_wifi_vap_info_t *rdk_vap_info } } +void process_frame_drop_unenc_command_event(void *data) +{ + assoc_dev_data_t *req; + mac_addr_str_t mac_str; + + if (data == NULL) { + wifi_util_error_print(WIFI_CTRL, "%s:%d NULL data\n", __func__, __LINE__); + return; + } + + req = (assoc_dev_data_t *)data; + to_mac_str(req->dev_stats.cli_MACAddress, mac_str); + + wifi_util_info_print(WIFI_CTRL, + "%s:%d: [FC_WEP] disassociating client %s on ap:%d reason=%d\n", + __func__, __LINE__, mac_str, req->ap_index, req->reason); + + wifi_hal_disassoc(req->ap_index, req->reason, req->dev_stats.cli_MACAddress); +} + void process_kick_assoc_devices_event(void *data) { wifi_util_dbg_print(WIFI_CTRL, "%s:%d Entry\n", __func__, __LINE__); @@ -4386,6 +4406,10 @@ void handle_command_event(wifi_ctrl_t *ctrl, void *data, unsigned int len, process_kick_assoc_devices_event(data); break; + case wifi_event_type_command_frame_drop_unenc: + process_frame_drop_unenc_command_event(data); + break; + case wifi_event_type_command_wps: process_wps_command_event(*(unsigned int *)data); break; diff --git a/source/core/wifi_events.c b/source/core/wifi_events.c index 530bdc547..ba9a09223 100644 --- a/source/core/wifi_events.c +++ b/source/core/wifi_events.c @@ -125,6 +125,7 @@ const char *wifi_event_subtype_to_string(wifi_event_subtype_t type) DOC2S(wifi_event_type_dfs_atbootup_rfc) DOC2S(wifi_event_type_command_kickmac) DOC2S(wifi_event_type_command_kick_assoc_devices) + DOC2S(wifi_event_type_command_frame_drop_unenc) DOC2S(wifi_event_type_command_wps) DOC2S(wifi_event_type_command_wps_pin) DOC2S(wifi_event_type_command_wps_cancel) diff --git a/source/stats/wifi_monitor.c b/source/stats/wifi_monitor.c index 7109c5215..365f383db 100644 --- a/source/stats/wifi_monitor.c +++ b/source/stats/wifi_monitor.c @@ -3996,6 +3996,7 @@ int device_disassociated(int ap_index, char *src_mac, char *dest_mac, int type, int device_frame_drop_unencrypted(int ap_index, char *src_mac, unsigned short ether_type) { mac_address_t sta_mac; + assoc_dev_data_t assoc_data; char cli_ip_str[IP_STR_LEN] = { 0 }; char cli_interface_str[IFNAMSIZ] = { 0 }; const int reason = WLAN_REASON_PREV_AUTH_NOT_VALID; @@ -4019,10 +4020,16 @@ int device_frame_drop_unencrypted(int ap_index, char *src_mac, unsigned short et } wifi_util_info_print(WIFI_MON, - "%s:%d: [FC_WEP] client[%s] on ap:%d (ethertype:0x%04x) has no IPv4 - disassociating\n", + "%s:%d: [FC_WEP] client[%s] on ap:%d (ethertype:0x%04x) has no IPv4 - " + "queueing disassoc\n", __func__, __LINE__, src_mac, ap_index, ether_type); - wifi_hal_disassoc(ap_index, reason, sta_mac); + memset(&assoc_data, 0, sizeof(assoc_data)); + assoc_data.ap_index = ap_index; + assoc_data.reason = reason; + memcpy(assoc_data.dev_stats.cli_MACAddress, sta_mac, sizeof(mac_address_t)); + push_event_to_ctrl_queue(&assoc_data, sizeof(assoc_data), + wifi_event_type_command, wifi_event_type_command_frame_drop_unenc, NULL); return 0; } From a69f4b9af1d2a9ffe6fa2a2fd835a92c87728d4f Mon Sep 17 00:00:00 2001 From: Rajagopalaswamy M Date: Thu, 16 Jul 2026 08:38:10 +0000 Subject: [PATCH 3/4] Addressed copilot reviews --- source/core/wifi_events.c | 1 + source/stats/wifi_monitor.c | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/source/core/wifi_events.c b/source/core/wifi_events.c index ba9a09223..a2b3544a6 100644 --- a/source/core/wifi_events.c +++ b/source/core/wifi_events.c @@ -219,6 +219,7 @@ bool is_high_priority_event(wifi_event_subtype_t sub_type) switch (sub_type) { case wifi_event_type_notify_monitor_done: case wifi_event_type_command_factory_reset: + case wifi_event_type_command_frame_drop_unenc: case wifi_event_type_eth_bh_status: case wifi_event_type_xfinity_enable: case wifi_event_type_prefer_private_rfc: diff --git a/source/stats/wifi_monitor.c b/source/stats/wifi_monitor.c index 365f383db..e124caba3 100644 --- a/source/stats/wifi_monitor.c +++ b/source/stats/wifi_monitor.c @@ -4004,7 +4004,14 @@ int device_frame_drop_unencrypted(int ap_index, char *src_mac, unsigned short et if (src_mac == NULL) { wifi_util_dbg_print(WIFI_MON, "%s:%d input mac is NULL for ap_index:%d\n", __func__, __LINE__, ap_index); - return -1; + return RETURN_ERR; + } + + if (active_sta_connection_status(ap_index, src_mac) == false) { + wifi_util_dbg_print(WIFI_MON, + "%s:%d: [FC_WEP] client[%s] not active on ap:%d - ignoring\n", + __func__, __LINE__, src_mac, ap_index); + return RETURN_OK; } str_to_mac_bytes(src_mac, sta_mac); @@ -4016,7 +4023,7 @@ int device_frame_drop_unencrypted(int ap_index, char *src_mac, unsigned short et wifi_util_info_print(WIFI_MON, "%s:%d: [FC_WEP] client[%s] has IPv4 %s on %s - no action\n", __func__, __LINE__, src_mac, cli_ip_str, cli_interface_str); - return 0; + return RETURN_OK; } wifi_util_info_print(WIFI_MON, @@ -4028,10 +4035,15 @@ int device_frame_drop_unencrypted(int ap_index, char *src_mac, unsigned short et assoc_data.ap_index = ap_index; assoc_data.reason = reason; memcpy(assoc_data.dev_stats.cli_MACAddress, sta_mac, sizeof(mac_address_t)); - push_event_to_ctrl_queue(&assoc_data, sizeof(assoc_data), - wifi_event_type_command, wifi_event_type_command_frame_drop_unenc, NULL); + if (push_event_to_ctrl_queue(&assoc_data, sizeof(assoc_data), + wifi_event_type_command, wifi_event_type_command_frame_drop_unenc, NULL) != RETURN_OK) { + wifi_util_error_print(WIFI_MON, + "%s:%d: [FC_WEP] failed to queue disassoc for client[%s] on ap:%d\n", + __func__, __LINE__, src_mac, ap_index); + return RETURN_ERR; + } - return 0; + return RETURN_OK; } void notify_radius_endpoint_change(radius_fallback_and_failover_data_t *radius_data) From a5151c5610c3b659478ad8612dc202c4cb8b6cae Mon Sep 17 00:00:00 2001 From: Narendra Varma Dandu Date: Thu, 16 Jul 2026 15:38:05 -0700 Subject: [PATCH 4/4] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- source/stats/wifi_monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/stats/wifi_monitor.c b/source/stats/wifi_monitor.c index e124caba3..b3494b797 100644 --- a/source/stats/wifi_monitor.c +++ b/source/stats/wifi_monitor.c @@ -4020,7 +4020,7 @@ int device_frame_drop_unencrypted(int ap_index, char *src_mac, unsigned short et * unprotected frames are blocking DHCP from ever succeeding. */ if (csi_getClientIpAddress(src_mac, cli_ip_str, cli_interface_str, 1) == 0 && cli_ip_str[0] != '\0') { - wifi_util_info_print(WIFI_MON, + wifi_util_dbg_print(WIFI_MON, "%s:%d: [FC_WEP] client[%s] has IPv4 %s on %s - no action\n", __func__, __LINE__, src_mac, cli_ip_str, cli_interface_str); return RETURN_OK;