diff --git a/agent/src/beerocks/slave/backhaul_manager/backhaul_manager_thread.cpp b/agent/src/beerocks/slave/backhaul_manager/backhaul_manager_thread.cpp index a9a05623d2..9699b3712c 100644 --- a/agent/src/beerocks/slave/backhaul_manager/backhaul_manager_thread.cpp +++ b/agent/src/beerocks/slave/backhaul_manager/backhaul_manager_thread.cpp @@ -2258,7 +2258,7 @@ bool backhaul_manager::handle_1905_topology_query(ieee1905_1::CmduMessageRx &cmd */ for (const auto &soc : slaves_sockets) { // Iterate on front radio iface and then switch to back radio iface - auto fill_radio_iface_info = [&](bool front_iface) { + auto fill_radio_iface_info = [&](ieee1905_1::eMediaType media_type, bool front_iface) { LOG(DEBUG) << "filling interface information on radio=" << (front_iface ? soc->radio_mac : soc->radio_mac + " backhaul"); @@ -2278,15 +2278,6 @@ bool backhaul_manager::handle_1905_topology_query(ieee1905_1::CmduMessageRx &cmd LOG(DEBUG) << "Added radio interface to tlvDeviceInformation: " << localInterfaceInfo->mac(); - std::string local_interface_name = front_iface ? soc->hostap_iface : soc->sta_iface; - - ieee1905_1::eMediaTypeGroup media_type_group = ieee1905_1::eMediaTypeGroup::IEEE_802_11; - ieee1905_1::eMediaType media_type = ieee1905_1::eMediaType::UNKNONWN_MEDIA; - if (!get_media_type(local_interface_name, media_type_group, media_type)) { - LOG(ERROR) << "Unable to compute media type for interface " << local_interface_name; - return false; - } - localInterfaceInfo->media_type() = media_type; ieee1905_1::s802_11SpecificInformation media_info = {}; @@ -2328,13 +2319,22 @@ bool backhaul_manager::handle_1905_topology_query(ieee1905_1::CmduMessageRx &cmd return true; }; - if (!fill_radio_iface_info(true)) { + std::string local_interface_name = soc->hostap_iface; + + ieee1905_1::eMediaTypeGroup media_type_group = ieee1905_1::eMediaTypeGroup::IEEE_802_11; + ieee1905_1::eMediaType media_type = ieee1905_1::eMediaType::UNKNONWN_MEDIA; + if (!get_media_type(local_interface_name, media_type_group, media_type)) { + LOG(ERROR) << "Unable to compute media type for interface " << local_interface_name; + return false; + } + + if (!fill_radio_iface_info(media_type, true)) { LOG(DEBUG) << "filling interface information on radio=" << soc->radio_mac << " has failed!"; return true; } - if (!fill_radio_iface_info(false)) { + if (!fill_radio_iface_info(media_type, false)) { LOG(DEBUG) << "filling interface information on radio=" << soc->radio_mac << " backhaul has failed!"; return true;