Commit b6a5e6e
Bluetooth: Host: Fix bt_conn reservation leak for extended advertising
This fixes a leak for the following scenario:
A bonded peer connects via undirected adv set while directed connectable
extended advertisement runs on the same identity.
The enhanced connection complete is cached, not yet processed and the
undirected set is terminated, which clears the `BT_ADV_ENABLED` flag.
During processing of the cached enhanced connection complete event, the
`find_pending_connect()` function then finds the directed set instead of
the undirected set (as until now there was no distinction of the
advertising set type in the lookup function). This leads to a
reservation leak, as the directed set is not terminated (but the
`BT_ADV_ENABLED` flag is cleared).
This commits adds the advertising set context to the
`bt_hci_le_enh_conn_complete()` and `find_pending_connect()` functions,
so that the correct advertising set is used for the lookup.
Note: This change has been locally tested with a test case created by AI
that reproduces the above scenario.
Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>1 parent 1f49157 commit b6a5e6e
3 files changed
Lines changed: 54 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2159 | 2159 | | |
2160 | 2160 | | |
2161 | 2161 | | |
2162 | | - | |
2163 | | - | |
| 2162 | + | |
| 2163 | + | |
2164 | 2164 | | |
2165 | 2165 | | |
2166 | 2166 | | |
2167 | 2167 | | |
2168 | 2168 | | |
2169 | | - | |
| 2169 | + | |
| 2170 | + | |
2170 | 2171 | | |
2171 | 2172 | | |
2172 | 2173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1258 | 1258 | | |
1259 | 1259 | | |
1260 | 1260 | | |
1261 | | - | |
| 1261 | + | |
| 1262 | + | |
1262 | 1263 | | |
1263 | 1264 | | |
1264 | 1265 | | |
| |||
1279 | 1280 | | |
1280 | 1281 | | |
1281 | 1282 | | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
1282 | 1310 | | |
1283 | 1311 | | |
1284 | 1312 | | |
| |||
1303 | 1331 | | |
1304 | 1332 | | |
1305 | 1333 | | |
1306 | | - | |
| 1334 | + | |
1307 | 1335 | | |
1308 | 1336 | | |
1309 | 1337 | | |
| |||
1363 | 1391 | | |
1364 | 1392 | | |
1365 | 1393 | | |
1366 | | - | |
| 1394 | + | |
1367 | 1395 | | |
1368 | 1396 | | |
1369 | 1397 | | |
| |||
1404 | 1432 | | |
1405 | 1433 | | |
1406 | 1434 | | |
1407 | | - | |
| 1435 | + | |
1408 | 1436 | | |
1409 | 1437 | | |
1410 | 1438 | | |
| |||
1442 | 1470 | | |
1443 | 1471 | | |
1444 | 1472 | | |
1445 | | - | |
| 1473 | + | |
| 1474 | + | |
1446 | 1475 | | |
1447 | 1476 | | |
1448 | 1477 | | |
| |||
1461 | 1490 | | |
1462 | 1491 | | |
1463 | 1492 | | |
1464 | | - | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
1465 | 1497 | | |
1466 | 1498 | | |
1467 | | - | |
| 1499 | + | |
1468 | 1500 | | |
1469 | 1501 | | |
1470 | 1502 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
353 | 354 | | |
354 | 355 | | |
355 | 356 | | |
| |||
516 | 517 | | |
517 | 518 | | |
518 | 519 | | |
519 | | - | |
| 520 | + | |
| 521 | + | |
520 | 522 | | |
521 | 523 | | |
522 | 524 | | |
| |||
0 commit comments