fix re-entrance issue that causes l2cap event channel open to be sent twice

This commit is contained in:
Matthias Ringwald 2015-07-12 00:00:31 +02:00
parent 0acdfac72b
commit 019f9b43ba

View File

@ -1172,6 +1172,8 @@ static int l2cap_channel_ready_for_open(l2cap_channel_t *channel){
// log_info("l2cap_channel_ready_for_open 0x%02x", channel->state_var);
if ((channel->state_var & L2CAP_CHANNEL_STATE_VAR_RCVD_CONF_RSP) == 0) return 0;
if ((channel->state_var & L2CAP_CHANNEL_STATE_VAR_SENT_CONF_RSP) == 0) return 0;
// addition check that fixes re-entrance issue causing l2cap event channel opened twice
if (channel->state == L2CAP_STATE_OPEN) return 0;
return 1;
}