Diff between 23a4b8af8b38058fb2249fbb8a941235d233f473 and 518a0d9f7b7cf15e71e5546e2a17d591010f58f9

Changed Files

File Additions Deletions Status
android/gatt.c +8 -0 modified

Full Patch

diff --git a/android/gatt.c b/android/gatt.c
index 49fff6f..45d70fd 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -1519,6 +1519,14 @@ static void connect_cb(GIOChannel *io, GError *gerr, gpointer user_data)
 		goto reply;
 	}
 
+	/* on BR/EDR MTU must not be less then minimal allowed MTU */
+	if (cid != ATT_CID && mtu < ATT_DEFAULT_L2CAP_MTU) {
+		error("gatt: MTU too small (%u bytes)", mtu);
+		device_set_state(dev, DEVICE_DISCONNECTED);
+		status = GATT_FAILURE;
+		goto reply;
+	}
+
 	DBG("mtu %u cid %u", mtu, cid);
 
 	/* on LE we always start with default MTU */