summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-10-12 20:25:50 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-10-12 20:25:50 +0000
commit5a6795edee5e8aa16c8b0aa6544b0ee1436d46a5 (patch)
tree7f80c3b8905690df3730e8e30ec817819035b670 /hcid
parentae1a0e6ffe8d14341f98d15a7a00dd6c21e3b3b5 (diff)
Check for correct L2CAP signaling command code when waiting for info request response
Diffstat (limited to 'hcid')
-rw-r--r--hcid/dbus-test.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/hcid/dbus-test.c b/hcid/dbus-test.c
index b15965d4..c78baeee 100644
--- a/hcid/dbus-test.c
+++ b/hcid/dbus-test.c
@@ -237,11 +237,6 @@ static gboolean l2raw_data_callback(GIOChannel *io, GIOCondition cond, struct au
return FALSE;
}
- if (audit->timeout) {
- g_timeout_remove(audit->timeout);
- audit->timeout = 0;
- }
-
if (cond & (G_IO_ERR | G_IO_HUP))
goto failed;
@@ -254,6 +249,14 @@ static gboolean l2raw_data_callback(GIOChannel *io, GIOCondition cond, struct au
goto failed;
}
+ if (cmd->code != L2CAP_INFO_RSP)
+ return TRUE;
+
+ if (audit->timeout) {
+ g_timeout_remove(audit->timeout);
+ audit->timeout = 0;
+ }
+
switch (audit->state) {
case AUDIT_STATE_MTU:
handle_mtu_response(audit, rsp);
@@ -286,6 +289,11 @@ static gboolean l2raw_data_callback(GIOChannel *io, GIOCondition cond, struct au
audit->mask_result, audit->mask);
failed:
+ if (audit->timeout) {
+ g_timeout_remove(audit->timeout);
+ audit->timeout = 0;
+ }
+
send_audit_status(audit, "AuditRemoteDeviceComplete");
g_io_channel_close(io);