diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2015-03-06 19:13:23 +0100 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2015-03-11 22:05:43 +0000 |
commit | 90797b95a02a2ab3c2790e17e999cbf1552daee8 (patch) | |
tree | ee1dbe1ce54c3e549d7ab2dbe51d6b0d451bb016 /epan | |
parent | c19860dba8d158c42865c3d9051b6f318cb41169 (diff) |
relay USB control messages without payload to protocol-specific dissectors
at the moment, we don't forward such messages and therefore see lots
of generic USB control messages that could be dissected further
even if there's no data, a protocol-specific dissector may still set
the columns based on conversation info
Change-Id: If3fc0f0ce3bdec1f91b7e3cadc3affd56b8c8969
Reviewed-on: https://code.wireshark.org/review/7584
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-usb.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c index e24d8e78b6..3b734cbee8 100644 --- a/epan/dissectors/packet-usb.c +++ b/epan/dissectors/packet-usb.c @@ -2715,15 +2715,14 @@ try_dissect_next_protocol(proto_tree *tree, tvbuff_t *next_tvb, packet_info *pin this is the (device or interface) class we're using */ guint32 usb_class; - if (tvb_captured_length(next_tvb) == 0) - return 0; - if (!usb_conv_info) { /* * Not enough information to choose the next protocol. * XXX - is there something we can still do here? */ - call_dissector(data_handle, next_tvb, pinfo, tree); + if (tvb_reported_length(next_tvb) > 0) + call_dissector(data_handle, next_tvb, pinfo, tree); + return tvb_captured_length(next_tvb); } @@ -2905,11 +2904,8 @@ dissect_usb_setup_response(packet_info *pinfo, proto_tree *tree, offset = dissect_usb_standard_setup_response(pinfo, parent, tvb, offset, usb_conv_info); } else { - /* Try to find a non-standard specific dissector */ - if (tvb_reported_length_remaining(tvb, offset) > 0) { - next_tvb = tvb_new_subset_remaining(tvb, offset); - offset += try_dissect_next_protocol(parent, next_tvb, pinfo, usb_conv_info, urb_type, tree); - } + next_tvb = tvb_new_subset_remaining(tvb, offset); + offset += try_dissect_next_protocol(parent, next_tvb, pinfo, usb_conv_info, urb_type, tree); length_remaining = tvb_reported_length_remaining(tvb, offset); if (length_remaining > 0) { |