Diff between d705186967566a6b49282be810c2f9ea7ea850d3 and 86beb4d9f00f70a58d04bace9c9a3ad671062b14

Changed Files

File Additions Deletions Status
emulator/bthost.c +19 -0 modified

Full Patch

diff --git a/emulator/bthost.c b/emulator/bthost.c
index da03559..ecb9a53 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -442,6 +442,20 @@ static bool l2cap_config_req(struct bthost *bthost, uint16_t handle,
 	send_l2cap_sig(bthost, handle, BT_L2CAP_PDU_CONFIG_RSP, ident, &rsp,
 								sizeof(rsp));
 
+	send_l2cap_sig(bthost, handle, BT_L2CAP_PDU_CONFIG_REQ, 0, req,
+								sizeof(*req));
+
+	return true;
+}
+
+static bool l2cap_config_rsp(struct bthost *bthost, uint16_t handle,
+				uint8_t ident, const void *data, uint16_t len)
+{
+	const struct bt_l2cap_pdu_config_rsp *rsp = data;
+
+	if (len < sizeof(*rsp))
+		return false;
+
 	return true;
 }
 
@@ -491,6 +505,11 @@ static void l2cap_sig(struct bthost *bthost, uint16_t handle, const void *data,
 			goto reject;
 		break;
 
+	case BT_L2CAP_PDU_CONFIG_RSP:
+		if (!l2cap_config_rsp(bthost, handle, hdr->ident,
+						data + sizeof(*hdr), hdr_len))
+			goto reject;
+		break;
 
 	case BT_L2CAP_PDU_INFO_REQ:
 		if (!l2cap_info_req(bthost, handle, hdr->ident,