diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-02-21 05:12:45 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-02-21 05:12:45 +0000 |
commit | 4d660fca67c64be84519ff8ae3f9d553ed676772 (patch) | |
tree | b782e98a7ccc4437bd700a5c7600f7efd7f1546e /packet-ethertype.c | |
parent | 0bee35e622d12fc3c3315bc952f0af981fbf0509 (diff) |
Save the current_proto value before calling subdissectors, and restore
it if we catch an exception (after showing the exception), so that
subsequent exceptions will have the right protocol.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10159 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-ethertype.c')
-rw-r--r-- | packet-ethertype.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packet-ethertype.c b/packet-ethertype.c index 3620a39b4d..bfef8e5d25 100644 --- a/packet-ethertype.c +++ b/packet-ethertype.c @@ -1,7 +1,7 @@ /* ethertype.c * Routines for calling the right protocol for the ethertype. * - * $Id: packet-ethertype.c,v 1.44 2004/02/21 00:33:31 guy Exp $ + * $Id: packet-ethertype.c,v 1.45 2004/02/21 05:12:44 guy Exp $ * * Gilbert Ramirez <gram@alumni.rice.edu> * @@ -151,6 +151,7 @@ ethertype(guint16 etype, tvbuff_t *tvb, int offset_after_etype, tvbuff_t *next_tvb; guint length_before; volatile gboolean dissector_found; + const char *saved_proto; /* Add the Ethernet type to the protocol tree */ if (tree) { @@ -170,6 +171,7 @@ ethertype(guint16 etype, tvbuff_t *tvb, int offset_after_etype, Catch exceptions, so that if the reported length of "next_tvb" was reduced by some dissector before an exception was thrown, we can still put in an item for the trailer. */ + saved_proto = pinfo->current_proto; TRY { dissector_found = dissector_try_port(ethertype_dissector_table, etype, next_tvb, pinfo, tree); @@ -198,9 +200,11 @@ ethertype(guint16 etype, tvbuff_t *tvb, int offset_after_etype, dissect the payload as data or update the protocol or info columns. We just show the exception and then drive on to show the trailer, after noting that a dissector was - found. */ - dissector_found = TRUE; + found and restoring the protocol value that was in effect + before we called the subdissector. */ show_exception(next_tvb, pinfo, tree, EXCEPT_CODE); + dissector_found = TRUE; + pinfo->current_proto = saved_proto; } ENDTRY; |