Diff between 3da0fb3a08c8e60e65d541afa2f4920425f72fb3 and 396d15b33796f88ce327158e0e2e79e8c3fa4c47

Changed Files

File Additions Deletions Status
tools/parser/avdtp.c +3 -2 modified
tools/parser/bpa.c +2 -2 modified
tools/parser/capi.c +1 -2 modified
tools/parser/hci.c +4 -1 modified
tools/parser/ppp.c +11 -0 modified
tools/parser/rfcomm.c +1 -2 modified

Full Patch

diff --git a/tools/parser/avdtp.c b/tools/parser/avdtp.c
index 2dd2477..6836058 100644
--- a/tools/parser/avdtp.c
+++ b/tools/parser/avdtp.c
@@ -459,8 +459,9 @@ void avdtp_dump(int level, struct frame *frm)
 		nsp = (hdr & 0x0c) == 0x04 ? get_u8(frm) : 0;
 		sid = hdr & 0x08 ? 0x00 : get_u8(frm);
 
-		printf("AVDTP(s): %s %s: transaction %d\n",
-			hdr & 0x08 ? pt2str(hdr) : si2str(sid), mt2str(hdr), hdr >> 4);
+		printf("AVDTP(s): %s %s: transaction %d nsp 0x%02x\n",
+			hdr & 0x08 ? pt2str(hdr) : si2str(sid),
+			mt2str(hdr), hdr >> 4, nsp);
 
 		switch (sid & 0x7f) {
 		case 0x01:
diff --git a/tools/parser/bpa.c b/tools/parser/bpa.c
index 291d4ca..016f1bd 100644
--- a/tools/parser/bpa.c
+++ b/tools/parser/bpa.c
@@ -58,8 +58,8 @@ void bpa_dump(int level, struct frame *frm)
 	channel = get_u8(frm);
 
 	p_indent(level, frm);
-	printf("BPA: id %d num %d status 0x%02x time %d channel %d\n",
-		id, num, status, time, channel);
+	printf("BPA: id %d num %d len %u status 0x%02x time %d channel %d\n",
+		id, num, len, status, time, channel);
 
 	raw_dump(level, frm);
 }
diff --git a/tools/parser/capi.c b/tools/parser/capi.c
index 788f4bd..f8cba3e 100644
--- a/tools/parser/capi.c
+++ b/tools/parser/capi.c
@@ -693,7 +693,6 @@ static void cmd_disconnect_b3(int level, uint8_t subcmd, struct frame *frm)
 static void cmd_data_b3(int level, uint8_t subcmd, struct frame *frm)
 {
 	uint32_t data;
-	uint64_t data64;
 	uint16_t length, handle, flags, info;
 
 	cmd_common(level, 0x00, frm);
@@ -724,7 +723,7 @@ static void cmd_data_b3(int level, uint8_t subcmd, struct frame *frm)
 		printf("Flags: 0x%04x\n", flags);
 
 		if (data == 0)
-			data64 = get_u64(frm);
+			(void) get_u64(frm);
 
 		raw_dump(level, frm);
 	}
diff --git a/tools/parser/hci.c b/tools/parser/hci.c
index e4a3633..b85cc14 100644
--- a/tools/parser/hci.c
+++ b/tools/parser/hci.c
@@ -3958,8 +3958,11 @@ static inline void sco_dump(int level, struct frame *frm)
 	uint8_t flags = acl_flags(handle);
 	int len;
 
-	if (frm->audio_fd > fileno(stderr))
+	if (frm->audio_fd > fileno(stderr)) {
 		len = write(frm->audio_fd, frm->ptr + HCI_SCO_HDR_SIZE, hdr->dlen);
+		if (len < 0)
+			return;
+	}
 
 	if (!p_filter(FILT_SCO)) {
 		p_indent(level, frm);
diff --git a/tools/parser/ppp.c b/tools/parser/ppp.c
index 875e5df..99165c4 100644
--- a/tools/parser/ppp.c
+++ b/tools/parser/ppp.c
@@ -176,12 +176,23 @@ void ppp_dump(int level, struct frame *frm)
 
 		id = 0x07;
 		err = write(frm->pppdump_fd, &id, 1);
+		if (err < 0)
+			return;
+
 		err = write(frm->pppdump_fd, &ts, 4);
+		if (err < 0)
+			return;
 
 		id = frm->in ? 0x02 : 0x01;
 		err = write(frm->pppdump_fd, &id, 1);
+		if (err < 0)
+			return;
 		err = write(frm->pppdump_fd, &len, 2);
+		if (err < 0)
+			return;
 		err = write(frm->pppdump_fd, frm->ptr, frm->len);
+		if (err < 0)
+			return;
 	}
 
 	if (!ppp_traffic) {
diff --git a/tools/parser/rfcomm.c b/tools/parser/rfcomm.c
index c2a278d..25e7ae1 100644
--- a/tools/parser/rfcomm.c
+++ b/tools/parser/rfcomm.c
@@ -55,11 +55,10 @@ static void print_rfcomm_hdr(long_frame_head* head, uint8_t *ptr, int len)
 	address_field addr = head->addr;
 	uint8_t ctr = head->control;
 	uint16_t ilen = head->length.bits.len;
-	uint8_t ctr_type,pf,dlci,fcs;
+	uint8_t pf, dlci, fcs;
 
 	dlci     = GET_DLCI(addr);
 	pf       = GET_PF(ctr);
-	ctr_type = CLR_PF(ctr);
 	fcs      = *(ptr + len - 1);
 
 	printf("cr %d dlci %d pf %d ilen %d fcs 0x%x ", addr.cr, dlci, pf, ilen, fcs);