aboutsummaryrefslogtreecommitdiffstats
path: root/packet-wcp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-04-10 19:10:10 +0000
committerGuy Harris <guy@alum.mit.edu>2001-04-10 19:10:10 +0000
commit7f0aaa324de03469e31b3e04b8a4209752ea1c1d (patch)
tree3aa1b681ff8197417b259053ec13918835fe4b5d /packet-wcp.c
parent7c145dc63e956cf875a68f962f16537a5837020f (diff)
If the tvbuff pointer is null in "alloc_field_info()", get the data
source name from "pi.compat_top_tvb", which should always be set to the tvbuff that refers to the data that old-style dissectors are currently working on. Arrange that it be so set in those dissectors that create alternate data sources and call other dissectors, and also arrange that "pi.len" and "pi.captured_len" be set appropriately as well. svn path=/trunk/; revision=3286
Diffstat (limited to 'packet-wcp.c')
-rw-r--r--packet-wcp.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/packet-wcp.c b/packet-wcp.c
index 7b6dc24bf2..afbe8e5af8 100644
--- a/packet-wcp.c
+++ b/packet-wcp.c
@@ -2,7 +2,7 @@
* Routines for Wellfleet Compression frame disassembly
* Copyright 2001, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-wcp.c,v 1.8 2001/03/30 10:51:50 guy Exp $
+ * $Id: packet-wcp.c,v 1.9 2001/04/10 19:10:09 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -309,6 +309,8 @@ void dissect_wcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
int wcp_header_len;
guint16 temp, cmd, ext_cmd, seq;
tvbuff_t *next_tvb;
+ packet_info save_pi;
+ gboolean must_restore_pi = FALSE;
pinfo->current_proto = "WCP";
@@ -394,6 +396,14 @@ void dissect_wcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
"[Malformed Frame: Bad WCP compressed data]" );
return;
}
+
+ /* Save the current value of "pi", and adjust certain fields to
+ reflect the new tvbuff. */
+ save_pi = pi;
+ pi.compat_top_tvb = next_tvb;
+ pi.len = tvb_reported_length(next_tvb);
+ pi.captured_len = tvb_length(next_tvb);
+ must_restore_pi = TRUE;
}
if ( tree) /* add the check byte */
@@ -403,6 +413,9 @@ void dissect_wcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
dissect_fr_uncompressed(next_tvb, pinfo, tree);
+ if (must_restore_pi)
+ pi = save_pi;
+
return;
}