Diff between f36f71f60b1e68c0f12e615b9b128d089ec3dd19 and 9c82249b8de260036b1327c990b62c9969eaaa2e

Changed Files

File Additions Deletions Status
src/shared/att.c +17 -0 modified

Full Patch

diff --git a/src/shared/att.c b/src/shared/att.c
index 04577ed..0ea6d55 100644
--- a/src/shared/att.c
+++ b/src/shared/att.c
@@ -836,6 +836,22 @@ static void handle_notify(struct bt_att *att, uint8_t opcode, uint8_t *pdu,
 		if (!opcode_match(notify->opcode, opcode))
 			continue;
 
+		/* BLUETOOTH CORE SPECIFICATION Version 5.1 | Vol 3, Part G
+		 * page 2370
+		 *
+		 * 4.3.1 Exchange MTU
+		 *
+		 * This sub-procedure shall not be used on a BR/EDR physical
+		 * link since the MTU size is negotiated using L2CAP channel
+		 * configuration procedures.
+		 */
+		if (bt_att_get_link_type(att) == BT_ATT_LINK_BREDR) {
+			switch (opcode) {
+			case BT_ATT_OP_MTU_REQ:
+				goto not_supported;
+			}
+		}
+
 		found = true;
 
 		if (notify->callback)
@@ -847,6 +863,7 @@ static void handle_notify(struct bt_att *att, uint8_t opcode, uint8_t *pdu,
 			break;
 	}
 
+not_supported:
 	/*
 	 * If this was not a command and no handler was registered for it,
 	 * respond with "Not Supported"