summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-ieee8021ah.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/epan/dissectors/packet-ieee8021ah.c b/epan/dissectors/packet-ieee8021ah.c
index 91fc430b68..48e4d70d9e 100644
--- a/epan/dissectors/packet-ieee8021ah.c
+++ b/epan/dissectors/packet-ieee8021ah.c
@@ -312,8 +312,8 @@ void
dissect_ieee8021ah(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree)
{
- proto_tree *ptree;
- guint32 tci;
+ proto_item *pi;
+ guint32 tci;
proto_tree *volatile ieee8021ah_tree;
int proto_tree_index;
@@ -331,14 +331,13 @@ dissect_ieee8021ah(tvbuff_t *tvb, packet_info *pinfo,
(tci >> 29), ((tci >> 28) & 1), ((tci >> 27) & 1),
((tci >> 26) & 1), ((tci >> 24) & 3), (tci & 0x00FFFFFF));
- /* create the protocol tree */
- ieee8021ah_tree = NULL;
-
- if (tree) {
- ptree = proto_tree_add_item(tree, proto_tree_index, tvb, 0, IEEE8021AH_LEN, ENC_NA);
- ieee8021ah_tree = proto_item_add_subtree(ptree, ett_ieee8021ah);
+ pi = proto_tree_add_item(tree, proto_tree_index, tvb, 0, IEEE8021AH_LEN, ENC_NA);
+ ieee8021ah_tree = proto_item_add_subtree(pi, ett_ieee8021ah);
- dissect_ieee8021ah_common(tvb, pinfo, ieee8021ah_tree, tree, proto_tree_index);
+ if (ieee8021ah_tree) {
+ dissect_ieee8021ah_common(tvb, pinfo, ieee8021ah_tree, tree, proto_tree_index);
+ } else {
+ dissect_ieee8021ah_common(tvb, pinfo, tree, NULL, proto_tree_index);
}
}