-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
bluetooth: id: fix adv sets with same id use different RPA #68892
bluetooth: id: fix adv sets with same id use different RPA #68892
Conversation
7d3726f
to
0c723a7
Compare
@niym-ot modified your PR text to use the proper way of linking PRs with issues (see https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) |
Could you add a bsim test for this functionality? |
0c723a7
to
a6ee98b
Compare
Can we add a new test instead of modifying an old one? I think it's much easier to navigate single-purpose tests with a clearly stated test purpose. |
a6ee98b
to
d1fc0aa
Compare
2d14654
to
6a52b14
Compare
@@ -56,15 +56,16 @@ static void validate_rpa_addr_generated_for_adv_sets(void) | |||
FAIL("RPA not same for adv sets with same id and RPA sharing enabled\n"); | |||
} | |||
} | |||
if (bt_addr_le_eq(&adv_set_data[0].old_addr, &adv_set_data[3].old_addr)) { | |||
if (bt_addr_le_eq(&adv_set_data[0].old_addr, &adv_set_data[2].old_addr)) { |
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.
Please move the refactors of other tests to a separate PR. You can tag it trivial.
You can keep the rename in this one.
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.
Removed the changes
create_adv(&adv_set[i], ID_2, true); | ||
break; | ||
case ADV_SET_INDEX_4: | ||
create_adv(&adv_set[i], ID_2, false); |
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.
Could you post a follow-up PR where you add another id w/ two other adv sets, that return false
for the first one and true
for the second one? Ie started in reverse order so the iterator hits the false
first.
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.
clarify: this comment is not a blocker.
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.
Noted. Will create a pull request for the same.
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.
7d3092f
to
d96a160
Compare
@@ -110,11 +111,10 @@ void start_advertising(void) | |||
|
|||
for (int i = 0; i < CONFIG_BT_EXT_ADV_MAX_ADV_SET; i++) { | |||
|
|||
if (i != ADV_SET_INDEX_THREE) { | |||
/* Create advertising set 1 and 2 with same id */ | |||
/* Create first 2 advertising sets with one id and remaining with another id */ |
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.
please revert changes to this test
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.
Done
The fix is to check if any of the adv set's rpa expired callback returns false, then all adv sets continues with the old RPA. Note: Fix is applicable only to adv sets which shares the same id. Signed-off-by: Nithin Ramesh Myliattil <[email protected]>
d96a160
to
d6a000b
Compare
The fix is to check if any of the adv set's rpa expired callback returns false, then all adv sets continues with the old RPA.
Note: Fix is applicable only to adv sets which shares the same id.
fixes #64625