diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2016-06-13 09:30:30 -0700 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-06-13 19:44:03 +0000 |
commit | 3fe879b88e53f3388653dde9a4631b45ca7290c7 (patch) | |
tree | cda1c25a1128d5997033f0e238707148d2ede71e /epan/dissectors/packet-isns.c | |
parent | 30d1afb6be1e1471a06ae5f2d8aa5adb0882c0f8 (diff) |
isns: fix dead code
do the special handling for len==0 and tag==ISNS_ATTR_TAG_PORTAL_GROUP_TAG
before going into the different attributes
Bug: 12503
Change-Id: I4dd6dcea25aba2e4963811a7a85f1eed1b906bcd
Reviewed-on: https://code.wireshark.org/review/15875
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-isns.c')
-rw-r--r-- | epan/dissectors/packet-isns.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/epan/dissectors/packet-isns.c b/epan/dissectors/packet-isns.c index f4d88aa6a7..109213bf6a 100644 --- a/epan/dissectors/packet-isns.c +++ b/epan/dissectors/packet-isns.c @@ -884,8 +884,14 @@ AddAttribute(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, guint offset, proto_item_append_text(attr_item, ": %s", val_to_str_ext_const(tag, &isns_attribute_tags_ext, "Unknown")); /* it seems that an empty attribute is always valid, the original code had a similar statement */ - if (len==0) + if (len==0) { + if ((tag==ISNS_ATTR_TAG_PORTAL_GROUP_TAG) && + ((function_id==ISNS_FUNC_DEVATTRREG) || (function_id==ISNS_FUNC_RSP_DEVATTRREG))) { + /* 5.6.5.1 */ + proto_tree_add_uint_format_value(tree, hf_isns_portal_group_tag, tvb, offset, 8, 0, "<NULL>"); + } return offset; + } switch( tag ) { @@ -986,14 +992,8 @@ AddAttribute(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, guint offset, dissect_isns_attr_port(tvb, offset, attr_tree, hf_isns_pg_portal_port, ISNS_OTHER_PORT, pinfo); break; case ISNS_ATTR_TAG_PORTAL_GROUP_TAG: - if((len==0) && ((function_id==ISNS_FUNC_DEVATTRREG) || (function_id==ISNS_FUNC_RSP_DEVATTRREG))) { - /* 5.6.5.1 */ - proto_tree_add_uint_format_value(tree, hf_isns_portal_group_tag, tvb, offset, 8, 0, "<NULL>"); - } - else { - ISNS_REQUIRE_ATTR_LEN(4); - proto_tree_add_item(attr_tree, hf_isns_portal_group_tag, tvb, offset, len, ENC_BIG_ENDIAN); - } + ISNS_REQUIRE_ATTR_LEN(4); + proto_tree_add_item(attr_tree, hf_isns_portal_group_tag, tvb, offset, len, ENC_BIG_ENDIAN); break; case ISNS_ATTR_TAG_PORTAL_GROUP_INDEX: ISNS_REQUIRE_ATTR_LEN(4); |