forked from osmocom/wireshark
Remove "length only" check for dissectors that use tcp_dissect_pdus.
If a TCP segment is small enough, dissectors that have a only a length check determining if it's their packet or not before calling tcp_dissect_pdus will throw out packets that are probably destined for them. Change-Id: I78034307b56aa537943191a6887166577936a6a3 Reviewed-on: https://code.wireshark.org/review/21950 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
parent
aabb8fd594
commit
d73fdc7079
|
@ -2839,10 +2839,6 @@ dissect_enip_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
|
|||
static int
|
||||
dissect_enip_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
|
||||
{
|
||||
/* An ENIP packet is at least 4 bytes long. */
|
||||
if (tvb_captured_length(tvb) < 4)
|
||||
return 0;
|
||||
|
||||
tcp_dissect_pdus(tvb, pinfo, tree, enip_desegment, 4, get_enip_pdu_len, dissect_enip_pdu, data);
|
||||
return tvb_captured_length(tvb);
|
||||
}
|
||||
|
|
|
@ -1385,9 +1385,6 @@ static int
|
|||
dissect_hartip_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
||||
void *data)
|
||||
{
|
||||
if (!tvb_bytes_exist(tvb, 0, HARTIP_HEADER_LENGTH))
|
||||
return 0;
|
||||
|
||||
tcp_dissect_pdus(tvb, pinfo, tree, hartip_desegment, HARTIP_HEADER_LENGTH,
|
||||
get_dissect_hartip_len, dissect_hartip_pdu, data);
|
||||
return tvb_reported_length(tvb);
|
||||
|
|
|
@ -361,10 +361,6 @@ dissect_hpfeeds_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
|
|||
static int
|
||||
dissect_hpfeeds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
|
||||
{
|
||||
/* At lease header is needed */
|
||||
if (tvb_reported_length(tvb) < HPFEEDS_HDR_LEN)
|
||||
return 0;
|
||||
|
||||
tcp_dissect_pdus(tvb, pinfo, tree, hpfeeds_desegment, HPFEEDS_HDR_LEN,
|
||||
get_hpfeeds_pdu_len, dissect_hpfeeds_pdu, data);
|
||||
return tvb_captured_length(tvb);
|
||||
|
|
|
@ -1514,10 +1514,6 @@ dissect_http2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
proto_item *ti;
|
||||
proto_tree *http2_tree;
|
||||
|
||||
/* Check that there's enough data */
|
||||
if (tvb_captured_length(tvb) < FRAME_HEADER_LENGTH)
|
||||
return 0;
|
||||
|
||||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "HTTP2");
|
||||
col_clear(pinfo->cinfo, COL_INFO);
|
||||
|
||||
|
|
|
@ -822,12 +822,6 @@ get_usbip_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset,
|
|||
static int
|
||||
dissect_usbip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
|
||||
{
|
||||
/* Check that there's enough data */
|
||||
if (tvb_reported_length(tvb) < 4) {
|
||||
/* usbip's smallest packet size is 4 */
|
||||
return 0;
|
||||
}
|
||||
|
||||
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, FRAME_HEADER_LEN,
|
||||
get_usbip_message_len, dissect_usbip_common, data);
|
||||
|
||||
|
|
Loading…
Reference in New Issue