aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-12-03 01:26:30 +0000
committerGuy Harris <guy@alum.mit.edu>2001-12-03 01:26:30 +0000
commitbf827fb28b551487995972d44e7b6bc05a53defb (patch)
tree29a8be1cc107d3f8758946613a64c7dffba59325 /epan/packet.c
parent95490bb044421b2fc25271ea75f55d7dafc3fdd1 (diff)
Don't bother saving or restoring "can_desegment" until you actually call
a subdissector. svn path=/trunk/; revision=4304
Diffstat (limited to 'epan/packet.c')
-rw-r--r--epan/packet.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/epan/packet.c b/epan/packet.c
index 7980583114..e82cf4a2e6 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.45 2001/12/03 01:20:51 guy Exp $
+ * $Id: packet.c,v 1.46 2001/12/03 01:26:30 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -368,14 +368,6 @@ dissector_try_port(dissector_table_t sub_dissectors, guint32 port,
guint32 saved_match_port;
guint16 saved_can_desegment;
- /* can_desegment is set to 2 by anyone which offers this api/service.
- then everytime a subdissector is called it is decremented by one.
- thus only the subdissector immediately ontop of whoever offers this
- serveice can use it.
- */
- saved_can_desegment=pinfo->can_desegment;
- pinfo->can_desegment = saved_can_desegment-(saved_can_desegment>0);
-
dtbl_entry = g_hash_table_lookup(sub_dissectors,
GUINT_TO_POINTER(port));
if (dtbl_entry != NULL) {
@@ -389,15 +381,25 @@ dissector_try_port(dissector_table_t sub_dissectors, guint32 port,
* so that other dissectors might have a chance
* to dissect this packet.
*/
- pinfo->can_desegment=saved_can_desegment;
return FALSE;
}
-
+
/*
* Yes, it's enabled.
*/
saved_proto = pinfo->current_proto;
saved_match_port = pinfo->match_port;
+ saved_can_desegment = pinfo->can_desegment;
+
+ /*
+ * can_desegment is set to 2 by anyone which offers the
+ * desegmentation api/service.
+ * Then everytime a subdissector is called it is decremented
+ * by one.
+ * Thus only the subdissector immediately on top of whoever
+ * offers this serveice can use it.
+ */
+ pinfo->can_desegment = saved_can_desegment-(saved_can_desegment>0);
pinfo->match_port = port;
if (dtbl_entry->current.proto_index != -1) {
pinfo->current_proto =
@@ -406,10 +408,9 @@ dissector_try_port(dissector_table_t sub_dissectors, guint32 port,
(*dtbl_entry->current.dissector)(tvb, pinfo, tree);
pinfo->current_proto = saved_proto;
pinfo->match_port = saved_match_port;
- pinfo->can_desegment=saved_can_desegment;
+ pinfo->can_desegment = saved_can_desegment;
return TRUE;
}
- pinfo->can_desegment=saved_can_desegment;
return FALSE;
}