nimble/l2cap: Disconnect CoC when too big SDU is sent by peer

This is to satisfy PTS and we actually planned to do so anyway.
This commit is contained in:
Łukasz Rymanowski
2020-03-07 01:09:21 +01:00
parent 531c49e31a
commit 7f0a9c9503
+3 -1
View File
@@ -199,9 +199,11 @@ ble_l2cap_coc_rx_fn(struct ble_l2cap_chan *chan)
sdu_len = get_le16((*om)->om_data);
if (sdu_len > rx->mtu) {
/* TODO Disconnect?*/
BLE_HS_LOG(INFO, "error: sdu_len > rx->mtu (%d>%d)\n",
sdu_len, rx->mtu);
/* Disconnect peer with invalid behaviour */
ble_l2cap_disconnect(chan);
return BLE_HS_EBADDATA;
}