l2cap-ertm: disconnect if ERTM mandatory but remote didn't send Retransmission and Flow Control option in Config Request

This commit is contained in:
Matthias Ringwald 2019-10-21 21:57:48 +02:00
parent b81345633b
commit 67f8f607ac

View File

@ -2592,6 +2592,10 @@ static void l2cap_signaling_handle_configure_request(l2cap_channel_t *channel, u
uint8_t update = channel->fcs_option || use_fcs;
log_info("local fcs: %u, remote fcs: %u -> %u", channel->fcs_option, use_fcs, update);
channel->fcs_option = update;
// If ERTM mandatory, but remote didn't send Retransmission and Flowcontrol options -> disconnect
if (((channel->state_var & L2CAP_CHANNEL_STATE_VAR_SEND_CONF_RSP_ERTM) == 0) & (channel->ertm_mandatory)){
channel->state = L2CAP_STATE_WILL_SEND_DISCONNECT_REQUEST;
}
#endif
}