Skip to content

Commit c537ac6

Browse files
hermabecarlescufi
authored andcommitted
Bluetooth: Host: Disallow sending unsupported MTU Exchange
The Exchange MTU sub-procedure shall only be supported on the LE Fixed Channel Unenhanced ATT bearer. This was checked when receiving, but sending was allowed. Signed-off-by: Herman Berget <[email protected]>
1 parent 73f5ffc commit c537ac6

File tree

1 file changed

+8
-0
lines changed
  • subsys/bluetooth/host

1 file changed

+8
-0
lines changed

subsys/bluetooth/host/att.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ static int chan_send(struct bt_att_chan *chan, struct net_buf *buf,
149149

150150
BT_DBG("code 0x%02x", hdr->code);
151151

152+
if (IS_ENABLED(CONFIG_BT_EATT) && hdr->code == BT_ATT_OP_MTU_REQ &&
153+
chan->chan.tx.cid != BT_L2CAP_CID_ATT) {
154+
/* The Exchange MTU sub-procedure shall only be supported on
155+
* the LE Fixed Channel Unenhanced ATT bearer
156+
*/
157+
return -ENOTSUP;
158+
}
159+
152160
if (IS_ENABLED(CONFIG_BT_EATT) &&
153161
atomic_test_bit(chan->flags, ATT_ENHANCED)) {
154162
/* Check if sent is pending already, if it does it cannot be

0 commit comments

Comments
 (0)