From 067c931cddaf039f1fa92adb334f4fac81a04395 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 5 Mar 2002 22:15:21 +0000 Subject: The length field in the TPKT header contains the length of the packet *including the length of the TPKT header itself*, not just the length of the payload. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4880 f5534014-38df-0310-8fa8-9805f1628bb7 --- packet-tpkt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'packet-tpkt.c') diff --git a/packet-tpkt.c b/packet-tpkt.c index 93424d98ff..d6f261bbca 100644 --- a/packet-tpkt.c +++ b/packet-tpkt.c @@ -7,7 +7,7 @@ * Routine to dissect RFC 1006 TPKT packet containing OSI TP PDU * Copyright 2001, Martin Thomas * - * $Id: packet-tpkt.c,v 1.16 2002/02/23 21:07:48 guy Exp $ + * $Id: packet-tpkt.c,v 1.17 2002/03/05 22:15:21 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -153,7 +153,7 @@ dissect_tpkt_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * Yes - is the payload split across segment * boundaries? */ - if (length_remaining < data_len + 4) { + if (length_remaining < data_len) { /* * Yes. Tell the TCP dissector where * the data for this message starts in @@ -162,7 +162,7 @@ dissect_tpkt_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, */ pinfo->desegment_offset = offset; pinfo->desegment_len = - (data_len + 4) - length_remaining; + data_len - length_remaining; return; } } @@ -202,6 +202,7 @@ dissect_tpkt_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* Skip the TPKT header. */ offset += 4; + data_len -= 4; /* * Construct a tvbuff containing the amount of the payload -- cgit v1.2.3