l2cap: handle l2cap local cid overrun, assert local cid is unique

This commit is contained in:
Milanka Ringwald 2019-09-02 11:52:01 +02:00
parent 6ddef68dd2
commit 6268fbfe8d

View File

@ -752,7 +752,14 @@ static void l2cap_ertm_handle_in_sequence_sdu(l2cap_channel_t * l2cap_channel, l
#endif
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){