Commit 16d748b
[nrf fromtree] bluetooth: host: Fix stale RPA usage after invalidation
Add !BT_ADV_RPA_VALID check to force RPA regeneration when re-enabling
an advertising set after RPA rotation occurred while disabled.
The BT_ADV_RANDOM_ADDR_UPDATED flag was added to prevent unnecessary
address regeneration (RPA/NRPA) between bt_le_ext_adv_param_set() and
bt_le_ext_adv_start() calls. However, this revealed an issue:
When RPA rotation (le_force_rpa_timeout) occurs while an advertiser is
disabled, BT_ADV_RPA_VALID is cleared but the RPA is not regenerated.
On subsequent bt_le_ext_adv_start() without a new param_set() call:
- BT_ADV_RANDOM_ADDR_UPDATED is already cleared (from previous start)
- Without BT_PER_ADV_ENABLED, no regeneration occurs
- Stale RPA is used, violating privacy requirements
Add !BT_ADV_RPA_VALID check for both connectable and non-connectable
advertisers to ensure fresh RPA generation when the previous RPA was
invalidated while the advertiser was disabled.
Fixes regression introduced in #98117.
Signed-off-by: Pavel Vasilyev <[email protected]>
(cherry picked from commit 6da559f56544aa2ed1c93071ffad203a523d432c)1 parent 52a2bce commit 16d748b
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1566 | 1566 | | |
1567 | 1567 | | |
1568 | 1568 | | |
1569 | | - | |
| 1569 | + | |
| 1570 | + | |
1570 | 1571 | | |
1571 | 1572 | | |
1572 | 1573 | | |
1573 | 1574 | | |
1574 | 1575 | | |
1575 | | - | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
1576 | 1579 | | |
1577 | 1580 | | |
1578 | 1581 | | |
| |||
0 commit comments