diff --git a/monitor/control.c b/monitor/control.c
index 95582a4..ae1a7ae 100644
--- a/monitor/control.c
+++ b/monitor/control.c
#include "btsnoop.h"
#include "control.h"
+#define MAX_PACKET_SIZE (1486 + 4)
+
struct control_data {
uint16_t channel;
int fd;
- unsigned char buf[HCI_MAX_FRAME_SIZE];
+ unsigned char buf[MAX_PACKET_SIZE];
uint16_t offset;
};
void control_reader(const char *path)
{
- unsigned char buf[HCI_MAX_FRAME_SIZE];
+ unsigned char buf[MAX_PACKET_SIZE];
uint16_t index, opcode, pktlen;
struct timeval tv;
diff --git a/monitor/hcidump.c b/monitor/hcidump.c
index 4eb0a49..e69bcb1 100644
--- a/monitor/hcidump.c
+++ b/monitor/hcidump.c
static void device_callback(int fd, uint32_t events, void *user_data)
{
struct hcidump_data *data = user_data;
- unsigned char buf[HCI_MAX_FRAME_SIZE];
+ unsigned char buf[HCI_MAX_FRAME_SIZE * 2];
unsigned char control[64];
struct msghdr msg;
struct iovec iov;
diff --git a/monitor/packet.c b/monitor/packet.c
index d90dc24..a080ff7 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
handle_str, extra_str);
if (size != dlen) {
- print_field("invalid packet size");
+ print_field("invalid packet size (%d != %d)", size, dlen);
+ packet_hexdump(data, size);
return;
}
handle_str, extra_str);
if (size != hdr->dlen) {
- print_field("invalid packet size");
+ print_field("invalid packet size (%d != %d)", size, hdr->dlen);
+ packet_hexdump(data, size);
return;
}