Loading system/stack/gatt/gatt_auth.cc +13 −10 Original line number Original line Diff line number Diff line Loading @@ -176,6 +176,7 @@ void gatt_enc_cmpl_cback(const RawAddress* bd_addr, tBT_TRANSPORT transport, tGATT_CLCB* p_clcb = p_tcb->pending_enc_clcb.front(); tGATT_CLCB* p_clcb = p_tcb->pending_enc_clcb.front(); p_tcb->pending_enc_clcb.pop_front(); p_tcb->pending_enc_clcb.pop_front(); if (p_clcb != NULL) { bool status = false; bool status = false; if (result == BTM_SUCCESS) { if (result == BTM_SUCCESS) { if (gatt_get_sec_act(p_tcb) == GATT_SEC_ENCRYPT_MITM) { if (gatt_get_sec_act(p_tcb) == GATT_SEC_ENCRYPT_MITM) { Loading @@ -186,13 +187,15 @@ void gatt_enc_cmpl_cback(const RawAddress* bd_addr, tBT_TRANSPORT transport, } } gatt_sec_check_complete(status, p_clcb, p_tcb->sec_act); gatt_sec_check_complete(status, p_clcb, p_tcb->sec_act); } /* start all other pending operation in queue */ /* start all other pending operation in queue */ std::deque<tGATT_CLCB*> new_pending_clcbs; std::deque<tGATT_CLCB*> new_pending_clcbs; while (!p_tcb->pending_enc_clcb.empty()) { while (!p_tcb->pending_enc_clcb.empty()) { tGATT_CLCB* p_clcb = p_tcb->pending_enc_clcb.front(); tGATT_CLCB* p_clcb = p_tcb->pending_enc_clcb.front(); p_tcb->pending_enc_clcb.pop_front(); p_tcb->pending_enc_clcb.pop_front(); if (gatt_security_check_start(p_clcb)) new_pending_clcbs.push_back(p_clcb); if (p_clcb != NULL && gatt_security_check_start(p_clcb)) new_pending_clcbs.push_back(p_clcb); } } p_tcb->pending_enc_clcb = new_pending_clcbs; p_tcb->pending_enc_clcb = new_pending_clcbs; } } Loading Loading @@ -229,7 +232,7 @@ void gatt_notify_enc_cmpl(const RawAddress& bd_addr) { while (!p_tcb->pending_enc_clcb.empty()) { while (!p_tcb->pending_enc_clcb.empty()) { tGATT_CLCB* p_clcb = p_tcb->pending_enc_clcb.front(); tGATT_CLCB* p_clcb = p_tcb->pending_enc_clcb.front(); p_tcb->pending_enc_clcb.pop_front(); p_tcb->pending_enc_clcb.pop_front(); if (gatt_security_check_start(p_clcb)) if (p_clcb != NULL && gatt_security_check_start(p_clcb)) new_pending_clcbs.push_back(p_clcb); new_pending_clcbs.push_back(p_clcb); } } p_tcb->pending_enc_clcb = new_pending_clcbs; p_tcb->pending_enc_clcb = new_pending_clcbs; Loading system/stack/gatt/gatt_utils.cc +7 −7 Original line number Original line Diff line number Diff line Loading @@ -1163,13 +1163,13 @@ void gatt_clcb_invalidate(tGATT_TCB* p_tcb, const tGATT_CLCB* p_clcb) { uint16_t cid = p_clcb->cid; uint16_t cid = p_clcb->cid; if (!p_tcb->pending_enc_clcb.empty()) { if (!p_tcb->pending_enc_clcb.empty()) { auto iter = std::find_if(p_tcb->pending_enc_clcb.begin(), for (size_t i = 0; i < p_tcb->pending_enc_clcb.size(); i++) { p_tcb->pending_enc_clcb.end(), if (p_tcb->pending_enc_clcb.at(i) == p_clcb) { [p_clcb](auto& el) { return el == p_clcb; }); if (iter != p_tcb->pending_enc_clcb.end()) { p_tcb->pending_enc_clcb.erase(iter); LOG_WARN("Removing clcb (%p) for conn id=0x%04x from pending_enc_clcb", LOG_WARN("Removing clcb (%p) for conn id=0x%04x from pending_enc_clcb", p_clcb, p_clcb->conn_id); p_clcb, p_clcb->conn_id); p_tcb->pending_enc_clcb.at(i) = NULL; break; } } } } } Loading Loading
system/stack/gatt/gatt_auth.cc +13 −10 Original line number Original line Diff line number Diff line Loading @@ -176,6 +176,7 @@ void gatt_enc_cmpl_cback(const RawAddress* bd_addr, tBT_TRANSPORT transport, tGATT_CLCB* p_clcb = p_tcb->pending_enc_clcb.front(); tGATT_CLCB* p_clcb = p_tcb->pending_enc_clcb.front(); p_tcb->pending_enc_clcb.pop_front(); p_tcb->pending_enc_clcb.pop_front(); if (p_clcb != NULL) { bool status = false; bool status = false; if (result == BTM_SUCCESS) { if (result == BTM_SUCCESS) { if (gatt_get_sec_act(p_tcb) == GATT_SEC_ENCRYPT_MITM) { if (gatt_get_sec_act(p_tcb) == GATT_SEC_ENCRYPT_MITM) { Loading @@ -186,13 +187,15 @@ void gatt_enc_cmpl_cback(const RawAddress* bd_addr, tBT_TRANSPORT transport, } } gatt_sec_check_complete(status, p_clcb, p_tcb->sec_act); gatt_sec_check_complete(status, p_clcb, p_tcb->sec_act); } /* start all other pending operation in queue */ /* start all other pending operation in queue */ std::deque<tGATT_CLCB*> new_pending_clcbs; std::deque<tGATT_CLCB*> new_pending_clcbs; while (!p_tcb->pending_enc_clcb.empty()) { while (!p_tcb->pending_enc_clcb.empty()) { tGATT_CLCB* p_clcb = p_tcb->pending_enc_clcb.front(); tGATT_CLCB* p_clcb = p_tcb->pending_enc_clcb.front(); p_tcb->pending_enc_clcb.pop_front(); p_tcb->pending_enc_clcb.pop_front(); if (gatt_security_check_start(p_clcb)) new_pending_clcbs.push_back(p_clcb); if (p_clcb != NULL && gatt_security_check_start(p_clcb)) new_pending_clcbs.push_back(p_clcb); } } p_tcb->pending_enc_clcb = new_pending_clcbs; p_tcb->pending_enc_clcb = new_pending_clcbs; } } Loading Loading @@ -229,7 +232,7 @@ void gatt_notify_enc_cmpl(const RawAddress& bd_addr) { while (!p_tcb->pending_enc_clcb.empty()) { while (!p_tcb->pending_enc_clcb.empty()) { tGATT_CLCB* p_clcb = p_tcb->pending_enc_clcb.front(); tGATT_CLCB* p_clcb = p_tcb->pending_enc_clcb.front(); p_tcb->pending_enc_clcb.pop_front(); p_tcb->pending_enc_clcb.pop_front(); if (gatt_security_check_start(p_clcb)) if (p_clcb != NULL && gatt_security_check_start(p_clcb)) new_pending_clcbs.push_back(p_clcb); new_pending_clcbs.push_back(p_clcb); } } p_tcb->pending_enc_clcb = new_pending_clcbs; p_tcb->pending_enc_clcb = new_pending_clcbs; Loading
system/stack/gatt/gatt_utils.cc +7 −7 Original line number Original line Diff line number Diff line Loading @@ -1163,13 +1163,13 @@ void gatt_clcb_invalidate(tGATT_TCB* p_tcb, const tGATT_CLCB* p_clcb) { uint16_t cid = p_clcb->cid; uint16_t cid = p_clcb->cid; if (!p_tcb->pending_enc_clcb.empty()) { if (!p_tcb->pending_enc_clcb.empty()) { auto iter = std::find_if(p_tcb->pending_enc_clcb.begin(), for (size_t i = 0; i < p_tcb->pending_enc_clcb.size(); i++) { p_tcb->pending_enc_clcb.end(), if (p_tcb->pending_enc_clcb.at(i) == p_clcb) { [p_clcb](auto& el) { return el == p_clcb; }); if (iter != p_tcb->pending_enc_clcb.end()) { p_tcb->pending_enc_clcb.erase(iter); LOG_WARN("Removing clcb (%p) for conn id=0x%04x from pending_enc_clcb", LOG_WARN("Removing clcb (%p) for conn id=0x%04x from pending_enc_clcb", p_clcb, p_clcb->conn_id); p_clcb, p_clcb->conn_id); p_tcb->pending_enc_clcb.at(i) = NULL; break; } } } } } Loading