mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-04 15:39:59 +00:00
l2cap: handle l2cap local cid overrun, assert local cid is unique
This commit is contained in:
parent
6ddef68dd2
commit
6268fbfe8d
@ -752,7 +752,14 @@ static void l2cap_ertm_handle_in_sequence_sdu(l2cap_channel_t * l2cap_channel, l
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static uint16_t l2cap_next_local_cid(void){
|
static uint16_t l2cap_next_local_cid(void){
|
||||||
return local_source_cid++;
|
do {
|
||||||
|
if (local_source_cid == 0xffff) {
|
||||||
|
local_source_cid = 0x40;
|
||||||
|
} else {
|
||||||
|
local_source_cid++;
|
||||||
|
}
|
||||||
|
} while (l2cap_get_channel_for_local_cid(local_source_cid) != NULL);
|
||||||
|
return local_source_cid;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t l2cap_next_sig_id(void){
|
static uint8_t l2cap_next_sig_id(void){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user