From 54c61033163c04db8e0dff76e3737748db50ad82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= Date: Tue, 28 Jul 2020 12:01:54 +0200 Subject: [PATCH 1/2] agent: agent_ucc_listener: handle the backhaul sta mac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When we get dev_get_param with the "macaddr" parameter and no SSID, we have to reply with the MAC address of the backhaul sta, and not the MAC address of the radio. From the CAPI specification: When SSID is not specified for the parameter "macaddr", it implies that device should return backhaul STA's MAC address. db: - Add a new function: get_bsta_mac_by_ruid(). Its sole purpose it to get the backhaul sta MAC address based on the ruid. agent_ucc_listener: - When the UCC requests a "macaddr" with no SSID, use get_bsta_mac_by_ruid() to find and return the backhaul sta MAC. MAP-4.2.2_BH24G:axepoint Signed-off-by: Raphaël Mélotte --- agent/src/beerocks/slave/agent_db.cpp | 13 +++++++++++++ agent/src/beerocks/slave/agent_db.h | 9 +++++++++ agent/src/beerocks/slave/agent_ucc_listener.cpp | 10 +++++++--- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/agent/src/beerocks/slave/agent_db.cpp b/agent/src/beerocks/slave/agent_db.cpp index c8341c9b2a..3e0104258a 100644 --- a/agent/src/beerocks/slave/agent_db.cpp +++ b/agent/src/beerocks/slave/agent_db.cpp @@ -114,4 +114,17 @@ bool AgentDB::get_mac_by_ssid(const sMacAddr &ruid, const std::string &ssid, sMa return false; } +bool AgentDB::get_bsta_mac_by_ruid(const sMacAddr &ruid, sMacAddr &value) +{ + value = net::network_utils::ZERO_MAC; + auto radio = get_radio_by_mac(ruid, AgentDB::eMacType::RADIO); + if (!radio) { + LOG(ERROR) << "No radio with ruid '" << ruid << "' found!"; + return false; + } + + value = radio->back.iface_mac; + return true; +} + } // namespace beerocks diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index 30893c248d..356e1fee1a 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -223,6 +223,15 @@ class AgentDB { */ bool get_mac_by_ssid(const sMacAddr &ruid, const std::string &ssid, sMacAddr &value); + /** + * @brief Get the MAC address of the backhaul sta based on the ruid. + * + * @param[in] ruid The Radio UID. + * @param[out] value The mac address of the backaul sta if found, else an invalid MAC (zero). + * @return true if the MAC address was found, false otherwise. + */ + bool get_bsta_mac_by_ruid(const sMacAddr &ruid, sMacAddr &value); + /** * @brief 1905.1 Neighbor device information * Information gathered from a neighbor device upon reception of a Topology Discovery message. diff --git a/agent/src/beerocks/slave/agent_ucc_listener.cpp b/agent/src/beerocks/slave/agent_ucc_listener.cpp index 6dbc52a352..229657445d 100644 --- a/agent/src/beerocks/slave/agent_ucc_listener.cpp +++ b/agent/src/beerocks/slave/agent_ucc_listener.cpp @@ -109,9 +109,13 @@ bool agent_ucc_listener::handle_dev_get_param(std::unordered_mapget_bsta_mac_by_ruid(ruid, mac_value)) { + LOG(ERROR) << " failed to find the backhaul sta MAC address for ruid '" << ruid_str; + value = "backhaul sta MAC not found for ruid '" + ruid_str + "'"; + return false; + } + value = tlvf::mac_to_string(mac_value); return true; } auto ssid = params["ssid"]; From 6322a0477001f420f9e08653f0389bb667a2b999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= Date: Tue, 4 Aug 2020 18:40:00 +0200 Subject: [PATCH 2/2] ci: bump the easymesh_cert version sniffer: use the tshark version from the environment. See commit 689a5c7ebd2d7e80f869d571bdde057927d90abd to have all the details about the issue. In a nutshell: the tshark version bundled in the certification repository has issues parsing some packets. Since we need to switch a new major version, it's easier to just rely on the version present on the environment instead of updating the bundled one. MAP-4.2.2_BH24G:axepoint NOTE: this commit hash needs to be updated again after the relevant MR have been merged, so no SOB for now. --- ci/easymesh_cert_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/easymesh_cert_version b/ci/easymesh_cert_version index a90fa08b78..ab20f5f387 100644 --- a/ci/easymesh_cert_version +++ b/ci/easymesh_cert_version @@ -1 +1 @@ -399a33ca960cece195c3605d08951b8766e6c90d +62af397ceba0f0c4d2e3ca19c66ca0a5d4ed1330