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

agent: backhaul_manager: get_media_type(): return true on success #1107

Closed
wants to merge 1 commit into from

Conversation

arnout
Copy link
Collaborator

@arnout arnout commented Apr 7, 2020

The get_media_type() function sets result to false by default. In the
IEEE_802_11, it wasn't set to true in the success case.

Set result to true before breaking out of the loop.

Fixes: #1097

@arnout arnout self-assigned this Apr 7, 2020
The get_media_type() function sets result to false by default. In the
IEEE_802_11, it wasn't set to true in the success case. This leads to
bug #1097.

Set result to true before breaking out of the loop.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
@arnout arnout force-pushed the bugfix/1097-no-topology-response branch from 58b1572 to 851378f Compare April 7, 2020 09:19
@arnout arnout requested a review from mariomaz April 7, 2020 09:26
@@ -3439,7 +3439,7 @@ bool backhaul_manager::get_media_type(const std::string &interface_name,
if ((std::get<0>(tuple) == radio_info.frequency_band) &&
(std::get<1>(tuple) == radio_info.max_bandwidth)) {
media_type = std::get<2>(tuple);

result = true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why can't we just return true in these cases?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's the multiple exit points vs. single exit point discussion, which I'm not sure we put to a vote.

@arnout
Copy link
Collaborator Author

arnout commented Apr 7, 2020

Mario did the same fix in parallel and his version is slightly better, so I'm closing this PR.

@arnout arnout closed this Apr 7, 2020
@arnout arnout deleted the bugfix/1097-no-topology-response branch May 7, 2020 07:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] No Topology Response message found
3 participants