aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2015-12-19 20:08:28 +0100
committerMartin Kaiser <wireshark@kaiser.cx>2015-12-20 14:06:24 +0000
commitdf101863731967da50586a801fb3e61870a2e03a (patch)
treecb666c6f0b11aee354ea9e53c19b8f88b73ac1dd
parentaa002845d931e0a17a35c93385054bddc8524b18 (diff)
[USB] dissect the data part in outgoing isochronous URBs on Linux
The kernel sets the URBs status to -EXDEV in this case. Don't require status == OK in this case. Set pinfo->p2p_dir for USB packets. Sent/received is from the perspective of the host. Bug: 11868 Change-Id: I2be2348507bef47272d3d8786019ec90457141ac Reviewed-on: https://code.wireshark.org/review/12731 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
-rw-r--r--epan/dissectors/packet-usb.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c
index 080e28a6c0..4062a2fb6b 100644
--- a/epan/dissectors/packet-usb.c
+++ b/epan/dissectors/packet-usb.c
@@ -3244,6 +3244,8 @@ usb_set_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, guint16 bus_id
pinfo->ptype = PT_USB;
pinfo->srcport = src_addr->endpoint;
pinfo->destport = dst_addr->endpoint;
+ /* sent/received is from the perspective of the USB host */
+ pinfo->p2p_dir = req ? P2P_DIR_SENT : P2P_DIR_RECV;
str_src_addr = address_to_str(wmem_packet_scope(), &pinfo->src);
str_dst_addr = address_to_str(wmem_packet_scope(), &pinfo->dst);
@@ -3514,10 +3516,13 @@ dissect_linux_usb_iso_transfer(packet_info *pinfo _U_, proto_tree *urb_tree,
proto_tree_add_uint(iso_desc_tree, hf_usb_iso_len, tvb, offset, 4, iso_len);
offset += 4;
- /* When the ISO status is OK and there is ISO data and this ISO data is
- * fully captured then show this data.
+ /* Show the ISO data if we captured them and either the status
+ is OK or the packet is sent from host to device.
+ The Linux kernel sets the status field in outgoing isochronous
+ URBs to -EXDEV and fills the data part with valid data.
*/
- if (!iso_status && iso_len && data_base + iso_off + iso_len <= tvb_captured_length(tvb)) {
+ if ((pinfo->p2p_dir==P2P_DIR_SENT || !iso_status) &&
+ iso_len && data_base + iso_off + iso_len <= tvb_captured_length(tvb)) {
proto_tree_add_item(iso_desc_tree, hf_usb_iso_data, tvb, data_base + iso_off, iso_len, ENC_NA);
proto_tree_set_appendix(iso_desc_tree, tvb, (gint)(data_base+iso_off), (gint)iso_len);
}