diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-02-21 05:12:45 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-02-21 05:12:45 +0000 |
commit | 357b107ece52c50250f812fcc4b9a9c783784c8b (patch) | |
tree | b782e98a7ccc4437bd700a5c7600f7efd7f1546e /packet-ethertype.c | |
parent | 663c7d599c11abb5e13455230ae050a1911efb4a (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.
svn path=/trunk/; revision=10159
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; |