diff options
author | Michael Mann <mmann78@netscape.net> | 2013-10-20 18:00:05 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-10-20 18:00:05 +0000 |
commit | df6594bbd2cd202f160c458a259b2943169c6646 (patch) | |
tree | 3c43ac5c4f22d0a4d0a672b2648c6c7e13fac069 /epan/dissectors | |
parent | a9d79ebb94b6e983283df90d4a909c8ee5e5b9fd (diff) |
Pass MPLS "private data" into subdissectors instead of using pinfo->private_data.
svn path=/trunk/; revision=52718
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-mpls-y1711.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-mpls.c | 9 | ||||
-rw-r--r-- | epan/dissectors/packet-mpls.h | 2 |
3 files changed, 8 insertions, 7 deletions
diff --git a/epan/dissectors/packet-mpls-y1711.c b/epan/dissectors/packet-mpls-y1711.c index 9027d27871..73cc880f21 100644 --- a/epan/dissectors/packet-mpls-y1711.c +++ b/epan/dissectors/packet-mpls-y1711.c @@ -114,9 +114,9 @@ static const value_string y1711_defect_type_vals[] = { }; static int -dissect_mpls_y1711(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_mpls_y1711(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - struct mplsinfo *mplsinfo = (struct mplsinfo *)pinfo->private_data; + struct mplsinfo *mplsinfo = (struct mplsinfo *)data; int offset = 0; proto_item *ti; proto_tree *mpls_y1711_tree; diff --git a/epan/dissectors/packet-mpls.c b/epan/dissectors/packet-mpls.c index 34f413dae2..0542add032 100644 --- a/epan/dissectors/packet-mpls.c +++ b/epan/dissectors/packet-mpls.c @@ -525,6 +525,9 @@ dissect_mpls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_set_str(pinfo->cinfo, COL_PROTOCOL, "MPLS"); col_set_str(pinfo->cinfo, COL_INFO, "MPLS Label Switched Packet"); + /* Ensure structure is initialized */ + memset(&mplsinfo, 0, sizeof(struct mplsinfo)); + /* Start Decoding Here. */ while (tvb_reported_length_remaining(tvb, offset) > 0) { @@ -539,8 +542,6 @@ dissect_mpls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) mplsinfo.bos = bos; mplsinfo.ttl = ttl; - pinfo->private_data = &mplsinfo; - if (tree) { proto_item *ti; proto_tree *mpls_tree; @@ -600,8 +601,8 @@ dissect_mpls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) next_tvb = tvb_new_subset_remaining(tvb, offset); /* 1) explicit label-to-dissector binding ? */ - found = dissector_try_uint(mpls_subdissector_table, label, - next_tvb, pinfo, tree); + found = dissector_try_uint_new(mpls_subdissector_table, label, + next_tvb, pinfo, tree, FALSE, &mplsinfo); if (found) return; diff --git a/epan/dissectors/packet-mpls.h b/epan/dissectors/packet-mpls.h index 544dd47ff1..ea4273768e 100644 --- a/epan/dissectors/packet-mpls.h +++ b/epan/dissectors/packet-mpls.h @@ -46,7 +46,7 @@ enum { /* * FF: private data passed from the MPLS dissector to subdissectors - * (pinfo->private_data). + * (data parameter). */ struct mplsinfo { guint32 label; /* last mpls label in label stack */ |