diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2010-10-08 17:48:22 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2010-10-08 17:48:22 +0000 |
commit | 33f116a46d8b3c304f682e04b3c1abda21c30588 (patch) | |
tree | 725ad8a515564516d2b3f3ee8ea1953ee100a7f0 /epan/dissectors/packet-isl.c | |
parent | 7321549932137acdedf5216226e74094ac749ef5 (diff) | |
download | wireshark-33f116a46d8b3c304f682e04b3c1abda21c30588.tar.gz wireshark-33f116a46d8b3c304f682e04b3c1abda21c30588.tar.bz2 wireshark-33f116a46d8b3c304f682e04b3c1abda21c30588.zip |
Restore pinfo->private_data after an exception was thrown by a subdissector.
This is necessary in case a subdissector had changed it but was unable to
restore it (due to the exception).
Remove check_col().
svn path=/trunk/; revision=34436
Diffstat (limited to 'epan/dissectors/packet-isl.c')
-rw-r--r-- | epan/dissectors/packet-isl.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/epan/dissectors/packet-isl.c b/epan/dissectors/packet-isl.c index 7363a5e577..1edb606018 100644 --- a/epan/dissectors/packet-isl.c +++ b/epan/dissectors/packet-isl.c @@ -149,6 +149,7 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int fcs_len) tvbuff_t *volatile next_tvb; tvbuff_t *volatile trailer_tvb = NULL; const char *saved_proto; + void *pd_save; col_set_str(pinfo->cinfo, COL_PROTOCOL, "ISL"); col_clear(pinfo->cinfo, COL_INFO); @@ -236,9 +237,8 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int fcs_len) field (which is, admittedly, an OUI). */ proto_tree_add_item(fh_tree, hf_isl_hsa, payload_tvb, 3, 3, FALSE); } - if (check_col(pinfo->cinfo, COL_INFO)) - col_add_fstr(pinfo->cinfo, COL_INFO, "VLAN ID: %u", - tvb_get_ntohs(tvb, 20) >> 1); + col_add_fstr(pinfo->cinfo, COL_INFO, "VLAN ID: %u", + tvb_get_ntohs(tvb, 20) >> 1); if (tree) { proto_tree_add_item(fh_tree, hf_isl_vlan_id, payload_tvb, 6, 2, FALSE); proto_tree_add_item(fh_tree, hf_isl_bpdu, payload_tvb, 6, 2, FALSE); @@ -272,6 +272,7 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int fcs_len) before an exception was thrown, we can still put in an item for the trailer. */ saved_proto = pinfo->current_proto; + pd_save = pinfo->private_data; TRY { /* Frames encapsulated in ISL include an FCS. */ call_dissector(eth_withfcs_handle, next_tvb, pinfo, tree); @@ -289,6 +290,13 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int fcs_len) Show the exception, and then drive on to show the trailer, restoring the protocol value that was in effect before we called the subdissector. */ + + /* Restore the private_data structure in case one of the + * called dissectors modified it (and, due to the exception, + * was unable to restore it). + */ + pinfo->private_data = pd_save; + show_exception(next_tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); pinfo->current_proto = saved_proto; } |