Diff between 0b83aa1cda133b8f24d4b4e0978dcbb556153b97 and a9ac5d2838f3c8d1408b45a280589233895a049f

Changed Files

File Additions Deletions Status
src/shared/btsnoop.c +6 -3 modified

Full Patch

diff --git a/src/shared/btsnoop.c b/src/shared/btsnoop.c
index 2427f18..212cbf7 100644
--- a/src/shared/btsnoop.c
+++ b/src/shared/btsnoop.c
@@ -342,15 +342,18 @@ static bool pklg_read_hci(struct btsnoop *btsnoop, struct timeval *tv,
 
 	if (btsnoop->pklg_v2) {
 		toread = le32toh(pkt.len) - (PKLG_PKT_SIZE - 4);
+
 		ts = le64toh(pkt.ts);
+		tv->tv_sec = ts & 0xffffffff;
+		tv->tv_usec = ts >> 32;
 	} else {
 		toread = be32toh(pkt.len) - (PKLG_PKT_SIZE - 4);
+
 		ts = be64toh(pkt.ts);
+		tv->tv_sec = ts >> 32;
+		tv->tv_usec = ts & 0xffffffff;
 	}
 
-	tv->tv_sec = ts >> 32;
-	tv->tv_usec = ts & 0xffffffff;
-
 	*index = 0;
 	*opcode = get_opcode_from_pklg(pkt.type);