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

Commit

Permalink
controller: use eMediaTypeGroup to check for wireless interfaces
Browse files Browse the repository at this point in the history
eMediaTypeGroup is defined as the MSB of the eMediaType, according to
Table 6-12—Media type (intfType) found in IEEE 1905.1a standard.

Instead of using minimum and maximum values of eMediaType to check for
wireless interfaces, use the value of eMediaTypeGroup.

Resulting code is easier to maintain and while we are at it, we also
include the newly created IEEE_802_11AX value.

Signed-off-by: Mario Maz <[email protected]>
  • Loading branch information
mariomaz authored and mergify[bot] committed Apr 6, 2020
1 parent 207559c commit 244c14a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions controller/src/beerocks/master/son_master_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1640,14 +1640,14 @@ bool master_thread::handle_cmdu_1905_topology_response(const std::string &src_ma
const auto &iface_mac = iface_info.mac();
auto iface_mac_str = network_utils::mac_to_string(iface_mac);

const auto media_type = iface_info.media_type();
const auto media_type = iface_info.media_type();
const auto media_type_group = media_type >> 8;

// For wireless interface it is defined on IEEE 1905.1 that the size of the media info
// is n=10 octets, which the size of s802_11SpecificInformation struct.
// For wired interface n=0.
if (media_type >= ieee1905_1::eMediaType::IEEE_802_11B_2_4_GHZ &&
media_type <= ieee1905_1::eMediaType::IEEE_802_11AF &&
iface_info.media_info_length() == 10) {
if ((ieee1905_1::eMediaTypeGroup::IEEE_802_11 == media_type_group) &&
(iface_info.media_info_length() == 10)) {

const auto media_info = reinterpret_cast<ieee1905_1::s802_11SpecificInformation *>(
iface_info.media_info(0));
Expand Down

0 comments on commit 244c14a

Please sign in to comment.