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

Hotfix/fix dcs flow issues #807

Merged
merged 5 commits into from
Feb 17, 2020
Merged

Hotfix/fix dcs flow issues #807

merged 5 commits into from
Feb 17, 2020

Conversation

itayx
Copy link
Collaborator

@itayx itayx commented Feb 11, 2020

all DCS code has been ported #562

DCS Validation has been started on both RDKB/UGW platforms.

This PR is used to fix small issues throughout the codebase in the DCS feature's flow

@tomereli
Copy link
Collaborator

DO NOT REVIEW
Next time, you can open a draft PR if you don't want people to review it just yet:)

@itayx itayx force-pushed the hotfix/fix-dcs-flow-issues branch from 7c40b1b to 3a82a48 Compare February 11, 2020 13:44
@itayx itayx mentioned this pull request Feb 11, 2020
Copy link
Collaborator

@kantera800 kantera800 left a comment

Choose a reason for hiding this comment

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

better 1st commit headline would be:
son_slave: fix cmdu typo in monitor message

better 2st commit headline would be:
get mac from hostap_mac in control message
also i would expect to know why reading radio_mac from notification is not correct.

@ghost ghost added this to the M1 - Certifiable agent with wired backhaul milestone Feb 13, 2020
Copy link
Collaborator

@arnout arnout left a comment

Choose a reason for hiding this comment

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

Please fix up the minor comments I made and merge. Take good care with the "fix bug in dereferencing scan results event" because I don't think it fixes anything, so either there was never any bug, or the bug is still there.

@@ -3359,7 +3359,8 @@ bool master_thread::handle_cmdu_control_message(const std::string &src_mac,
return false;
}

auto radio_mac = notification->radio_mac();
//get the mac from hostap_mac
auto radio_mac = network_utils::mac_from_string(hostap_mac);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This sounds wrong... "hostap" is normally used to indicate the VAP, not the radio.

But looking at the definition of hostap_mac, it is in fact wrongly named, because it takes the radio_mac from the beerocks header. So it's OK.

That said, a much better change would be to (in one commit) change the beginning of the function to

    auto radio_mac = beerocks_header->actionhdr()->radio_mac();
    auto hostap_mac = network_utils::mac_to_string(radio_mac);

and (optionally) in a second commit remove most instances of hostap_mac (in the logging, you can just use an sMacAddr directly now).

Also, the commit message should explain why you do this. The commit message just says "because we can". I thought it would be because you're going to remove the radio_mac from cACTION_CONTROL_CHANNEL_SCAN_TRIGGERED_NOTIFICATION, but you don't do that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since this change would effect more then just the DCS feature,
I'm going to create a new issue for it (assigned to me), and I'll add a Hotfix to solve this once I'm finished with my current issues

@@ -3359,7 +3359,8 @@ bool master_thread::handle_cmdu_control_message(const std::string &src_mac,
return false;
}

auto radio_mac = notification->radio_mac();
//get the mac from hostap_mac
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment is useless. It basically says "get the mac from the mac".

Comment on lines +3386 to +3392
//get the mac from hostap_mac
auto radio_mac = network_utils::mac_from_string(hostap_mac);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment.

Comment on lines +3427 to +3433
//get the mac from hostap_mac
auto radio_mac = network_utils::mac_from_string(hostap_mac);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment.

Comment on lines +3448 to +3454
//get the mac from hostap_mac
auto radio_mac = network_utils::mac_from_string(hostap_mac);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment.

Comment on lines +1513 to +1515
auto msg = static_cast<bwl::sCHANNEL_SCAN_RESULTS_NOTIFICATION *>(data);

auto &in_result = msg.channel_scan_results;
auto &in_result = msg->channel_scan_results;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Although the code indeed looks better like this, it does nothing to fix the issue mentioned in the commit message. in_result is still the same reference as it was before, so it will become invalid as soon as the lifetime of data ends.

I also don't see any problem with the lifetime of in_result. It is only used within this event handler, and no references are taken anywhere.

@@ -1216,7 +1216,8 @@ int cli_bml::set_dcs_continuous_scan_params_caller(int numOfArgs)

std::string::size_type pos;
//[radio_mac=<radio_mac> dwell_time=<dwell_time> interval_time='<interval_time>']"
for (int i = 1; i < numOfArgs; i++) { //first optional arg
for (int i = 0; i < numOfArgs; i++) { //first optional arg
std::cout << "args[" << i << "]: " << args.stringArgs[i] << std::endl;;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we really want to leave this debug thing in here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No.
It was an oversight that it stayed, removed due to it being unneeded

@arnout
Copy link
Collaborator

arnout commented Feb 14, 2020

Another little nitpick: @itayx you often use "crush" instead of "crash". Also some commit messages have wrong capitalisation or weird wrapping.

adam1985d and others added 4 commits February 16, 2020 16:37
When ACTION_MONITOR_CHANNEL_SCAN_RESULTS_NOTIFICATION is received from
the monitor, an ACTION_CONTROL_CHANNEL_SCAN_RESULTS_NOTIFICATION should
be sent to the controller.

Change from ACTION_MONITOR_CHANNEL_SCAN_RESULTS_NOTIFICATION to
ACTION_CONTROL_CHANNEL_SCAN_RESULTS_NOTIFICATION.

Signed-off-by: Adam Dov <[email protected]>
the hostap_mac is provided by the agent as part of the CMDU msg.

get radio_mac (sMac) from hostap_mac (string) using the wireless_utils
API

Signed-off-by: Adam Dov <[email protected]>
The sCHANNEL_SCAN_RESULTS_NOTIFICATION message was dereferenced
directly to channel_scan_results param, but then again dereferenced.
This caused a crash when freeing the buffer at the end of the scope.

Change, so the first dereference is done to the buffer and only
the second dereference is to the param inside the msg.

Signed-off-by: Adam Dov <[email protected]>
The bml cli command used to set the continuous params has an issue where
it ignores index 0 of the given arguments,
which depending on the arguments being sent could cause the next
function in the flow to crush

Changed the initial index to 0

Signed-off-by: Itay Elenzweig <[email protected]>
@itayx itayx force-pushed the hotfix/fix-dcs-flow-issues branch from 3a82a48 to 3182be6 Compare February 17, 2020 08:21
@itayx itayx merged commit 9c0fc36 into master Feb 17, 2020
@itayx itayx deleted the hotfix/fix-dcs-flow-issues branch February 17, 2020 12:28
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.

5 participants