-
Notifications
You must be signed in to change notification settings - Fork 139
RDKCOM-5492: RDKBDEV-3336 De-authenticating Hotspot Clients Upon DHCP Failure #818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 7 commits
f6ea8fc
ca5f21c
dce74a9
2e12713
7cd3b62
f3a2943
560fc84
b835ef4
3c5715f
c5e778a
a970652
b506839
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1682,6 +1682,43 @@ static void wifi_sta_5g_status_handler(char *event_name, raw_data_t *p_data, voi | |||||
| } | ||||||
| #endif | ||||||
|
|
||||||
| static void handlePrivateHotspotClientDisconnect(char *event_name, raw_data_t *p_data, void *userData) | ||||||
|
||||||
| { | ||||||
| (void)userData; | ||||||
| char *pTmp = NULL; | ||||||
| char mac[64] = {0}; | ||||||
|
||||||
| int index = 0; | ||||||
| char tmp_str[120]; | ||||||
|
|
||||||
| wifi_util_dbg_print(WIFI_CTRL, "%s:%d Received event:%s with data type:%x\n", __func__, __LINE__, | ||||||
| event_name, p_data->data_type); | ||||||
|
|
||||||
| pTmp = (char *)p_data->raw_data.bytes; | ||||||
|
|
||||||
| if((strcmp(event_name, WIFI_PRIVATE_HOTSPOT_CLIENT_IP) != 0) || (pTmp == NULL)) { | ||||||
| wifi_util_info_print(WIFI_CTRL,"%s:%d Invalid event received,%s:%x\n", __func__, __LINE__, event_name, p_data->data_type); | ||||||
|
||||||
| wifi_util_info_print(WIFI_CTRL,"%s:%d Invalid event received,%s:%x\n", __func__, __LINE__, event_name, p_data->data_type); | |
| wifi_util_error_print(WIFI_CTRL,"%s:%d Invalid event received,%s:%x\n", __func__, __LINE__, event_name, p_data->data_type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed review comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| mac[mac_len] = '\0'; | |
| mac[sizeof(mac)] = '\0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uchm this one would be dependent on chancing char mac[64] = {0}; to char mac[18], so might be safer to leave it as is - otherwise it will crash some strcpy down the line..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am keeping the original changes as mac is declared as char Mac[18], so valid indices are 0 to 17. Writing to Mac[18] is undefined behavior (out of bounds).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, you are correct. Just add -1, so that it would be sizeof(mac) - 1 and it should be fine.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since youre already initializing other local variables to zero at the beginning of the function, it would make sense to do the same for tmp_str.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed Review comment
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if(ctrl->privateHotspotIPSubscribed == false) { | |
| if(!ctrl->privateHotspotIPSubscribed) { |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| wifi_util_info_print(WIFI_CTRL, "%s:%d bus: bus event:%s subscribe fail\n", | |
| wifi_util_error_print(WIFI_CTRL, "%s:%d bus: bus event:%s subscribe fail\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stick to the naming convention