diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-03-05 22:15:21 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-03-05 22:15:21 +0000 |
commit | 067c931cddaf039f1fa92adb334f4fac81a04395 (patch) | |
tree | fb7c70665a14e7ef2d61cfdff7fb74c6e21f633e /packet-tpkt.c | |
parent | 7677a6fd1c95c86710a0d58f6352b84e74abac8f (diff) |
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
Diffstat (limited to 'packet-tpkt.c')
-rw-r--r-- | packet-tpkt.c | 7 |
1 files changed, 4 insertions, 3 deletions
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 <Martin_A_Thomas@yahoo.com> * - * $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 <gerald@ethereal.com> @@ -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 |