OSDN Git Service
(root)
/
android-x86
/
external-bluetooth-bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c64fd37
)
shared: Check HCI packet type before sending it to btdev
author
Marcel Holtmann
<marcel@holtmann.org>
Wed, 11 Sep 2013 14:13:31 +0000
(07:13 -0700)
committer
Marcel Holtmann
<marcel@holtmann.org>
Wed, 11 Sep 2013 14:13:31 +0000
(07:13 -0700)
src/shared/hciemu.c
patch
|
blob
|
history
diff --git
a/src/shared/hciemu.c
b/src/shared/hciemu.c
index
af8007c
..
90c21f3
100644
(file)
--- a/
src/shared/hciemu.c
+++ b/
src/shared/hciemu.c
@@
-162,10
+162,16
@@
static gboolean receive_btdev(GIOChannel *channel, GIOCondition condition,
fd = g_io_channel_unix_get_fd(channel);
len = read(fd, buf, sizeof(buf));
- if (len <
0
)
+ if (len <
1
)
return FALSE;
- btdev_receive_h4(btdev, buf, len);
+ switch (buf[0]) {
+ case BT_H4_CMD_PKT:
+ case BT_H4_ACL_PKT:
+ case BT_H4_SCO_PKT:
+ btdev_receive_h4(btdev, buf, len);
+ break;
+ }
return TRUE;
}