Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
fixup! agent: backhaul: compute MediaType for wireless interfaces in …
Browse files Browse the repository at this point in the history
…DeviceInformation TLV
  • Loading branch information
mariomaz committed Apr 6, 2020
1 parent 5d5bb4a commit 9a2de3a
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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 = {};
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9a2de3a

Please sign in to comment.