Skip to content

RDKBWIFI-445: Fixed binary data comparison in webconfig#1144

Open
vlad-safonov wants to merge 2 commits into
rdkcentral:developfrom
vlad-safonov:RDKBWIFI-445-wrong-vaps-in-ap-metric-report
Open

RDKBWIFI-445: Fixed binary data comparison in webconfig#1144
vlad-safonov wants to merge 2 commits into
rdkcentral:developfrom
vlad-safonov:RDKBWIFI-445-wrong-vaps-in-ap-metric-report

Conversation

@vlad-safonov
Copy link
Copy Markdown
Contributor

@vlad-safonov vlad-safonov commented May 21, 2026

Reason for change: AP metric report shows statistic for all VAP's from first VAP including the STA report
After investigation we found binary data comparing using strncmp, mac is starting with 0, treaded as comparison of two 0-length strings and always returning true

Test procedure: AP metric report should statistic for correct VAP
After STA connection statistic should be available only on one VAP
(without the patch it will be shown on all VAP's)

bez patcha STA pokazivajetsja na vseh vapah

Priority: Critical
Risk: Low

@vlad-safonov vlad-safonov requested a review from a team as a code owner May 21, 2026 14:56
@github-actions github-actions Bot added the community contribution Contributions from community. label May 21, 2026
@vlad-safonov
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

Nikita-Hakai
Nikita-Hakai previously approved these changes May 28, 2026
typedef void (*ext_proto_update_assoc_sta_mld_info_t)(void *data_model, em_assoc_sta_mld_info_t *assoc_sta_mld_info);
typedef em_ap_mld_info_t * (*ext_proto_get_ap_mld_frm_bssid_t)(void *data_model, mac_address_t bss_id);
typedef em_radio_cap_info_t * (*ext_proto_get_radio_cap_t)(void *data_model, int index);
typedef em_radio_cap_info_t * (*ext_proto_get_radio_cap_t)(void *data_model, unsigned int index);
Copy link
Copy Markdown
Contributor Author

@vlad-safonov vlad-safonov May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Nikita-Hakai , I would like to discuss this line - if we do it - it also requires some adjustments in unified-wifi-mesh, something like

diff --git a/inc/dm_easy_mesh.h b/inc/dm_easy_mesh.h
index bac8a20..aa2c217 100644
--- a/inc/dm_easy_mesh.h
+++ b/inc/dm_easy_mesh.h
@@ -1738,8 +1738,8 @@ public:
        void update_assoc_sta_mld_info(em_assoc_sta_mld_info_t *assoc_sta_mld_info);
        static void update_assoc_sta_mld_info(void *dm, em_assoc_sta_mld_info_t *assoc_sta_mld_info) { (static_cast<dm_easy_mesh_t *>(dm))->update_assoc_sta
_mld_info(assoc_sta_mld_info); }

-       em_radio_cap_info_t *get_radio_cap_info(int index);
-       static em_radio_cap_info_t *get_radio_cap_info(void *dm, int index) { return (static_cast<dm_easy_mesh_t *>(dm))->get_radio_cap_info(index); }
+       em_radio_cap_info_t *get_radio_cap_info(unsigned int index);
+       static em_radio_cap_info_t *get_radio_cap_info(void *dm, unsigned int index) { return (static_cast<dm_easy_mesh_t *>(dm))->get_radio_cap_info(index)
; }

        /**!
         * @brief Retrieves the Data Model DPP object.

and remove some castings which will make code cleaner, so do you want to have this fix here and merge it together with unified-wifi-mesh?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @vlad-safonov, sorry caught to this notification little late. I see that corresponding unified-wifi-mesh changes are raised, will have to merge it together. Can you kindly confirm, if the changes are good in the sense not breaking working functionality?

Copy link
Copy Markdown
Contributor Author

@vlad-safonov vlad-safonov Jun 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nikita-Hakai yes from my point of view it is safe, we performed tests and there are no regressions

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes incorrect BSSID matching in the webconfig AP metrics report path by replacing strncmp() (string semantics) with memcmp() (binary semantics) when comparing BSSID values, ensuring per-VAP metrics are attributed to the correct VAP.

Changes:

  • Replace strncmp() with memcmp() for BSSID comparisons in AP metrics encoding.
  • Replace strncmp() with memcmp() for BSSID comparisons while translating AP metrics to EasyMesh BSS info.
  • Update the external EasyMesh proto function-pointer typedef ext_proto_get_radio_cap_t to take an unsigned int index.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
source/webconfig/wifi_encoder.c Fixes binary BSSID comparison when mapping VAPs to AP metrics during encoding.
source/webconfig/wifi_easymesh_translator.c Fixes binary BSSID comparison when locating the matching VAP report during translation.
include/webconfig_external_proto_easymesh.h Adjusts get_radio_cap callback signature to use an unsigned index.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vlad-safonov vlad-safonov force-pushed the RDKBWIFI-445-wrong-vaps-in-ap-metric-report branch from e49b85a to dd1e99e Compare June 5, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community contribution Contributions from community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants