Diff between 8cd59c7734eedf60e566401a9ebf0c6f98aac9a2 and fac46295447bedcedd203c1983afaa4f9c8b8f05

Changed Files

File Additions Deletions Status
emulator/btdev.c +6 -2 modified

Full Patch

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 2a0c673..a2a2e50 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -2393,8 +2393,12 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode,
 
 	case BT_HCI_CMD_SET_HOST_FLOW_CONTROL:
 		shfc = data;
-		btdev->host_flow_control = shfc->enable;
-		status = BT_HCI_ERR_SUCCESS;
+		if (shfc->enable > 0x03) {
+			status = BT_HCI_ERR_INVALID_PARAMETERS;
+		} else {
+			btdev->host_flow_control = shfc->enable;
+			status = BT_HCI_ERR_SUCCESS;
+		}
 		cmd_complete(btdev, opcode, &status, sizeof(status));
 		break;