MYNEWT-698: Unhandled exception in ble_ll_conn_end This is another issue that should not occur but was discovered when testing with other devices. If the device sends a TERMINATE with "unknown connection ID (error 2)" this would cause the controller to access a NULL variable. This has now been fixed.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/a73a65bf Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/a73a65bf Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/a73a65bf Branch: refs/heads/master Commit: a73a65bfce7a86c0ef1d481c2506ab07a19f18fe Parents: d0763ab Author: William San Filippo <[email protected]> Authored: Mon Apr 3 09:34:55 2017 -0700 Committer: William San Filippo <[email protected]> Committed: Mon Apr 3 09:34:55 2017 -0700 ---------------------------------------------------------------------- net/nimble/controller/src/ble_ll_conn.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a73a65bf/net/nimble/controller/src/ble_ll_conn.c ---------------------------------------------------------------------- diff --git a/net/nimble/controller/src/ble_ll_conn.c b/net/nimble/controller/src/ble_ll_conn.c index 9a6dc1a..741ca0f 100644 --- a/net/nimble/controller/src/ble_ll_conn.c +++ b/net/nimble/controller/src/ble_ll_conn.c @@ -1703,7 +1703,9 @@ ble_ll_conn_end(struct ble_ll_conn_sm *connsm, uint8_t ble_err) * and we should not send an event */ if (ble_err) { - if (ble_err == BLE_ERR_UNK_CONN_ID) { + + if ((connsm->csmflags.cfbit.terminate_ind_rxd == 0) && + (ble_err == BLE_ERR_UNK_CONN_ID)) { evbuf = ble_ll_init_get_conn_comp_ev(); ble_ll_conn_comp_event_send(connsm, ble_err, evbuf, NULL); } else {
