diff options
author | Anish Bhatt <anish@chelsio.com> | 2014-04-28 13:40:27 -0700 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-04-28 20:49:21 +0000 |
commit | 3765e99a07f65a34b06d9d5b3b48805750d7021f (patch) | |
tree | b6f8321917b3292f8589d0b47d0d43000a99a179 /epan/dissectors/packet-lldp.c | |
parent | b512feda8a25304b085def8f6b7714ff5ec0c469 (diff) |
With the use of tvb_reported_length_remaining(), there is no need to calculate consumedLen anymore
Change-Id: I8f4c32012061d3bff5e4efb80dfce8d82f7400df
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1417
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-lldp.c')
-rw-r--r-- | epan/dissectors/packet-lldp.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/epan/dissectors/packet-lldp.c b/epan/dissectors/packet-lldp.c index baed41bdb3..efa7138893 100644 --- a/epan/dissectors/packet-lldp.c +++ b/epan/dissectors/packet-lldp.c @@ -1426,7 +1426,7 @@ dissect_dcbx_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint3 { guint8 subType; guint8 tempByte, tempCounter, appCount = 0; - guint16 tempLen, consumedLen = 0; + guint16 tempLen; guint16 tempShort; guint32 tempOffset = offset; @@ -1438,7 +1438,6 @@ dissect_dcbx_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint3 proto_tree_add_item(tree, hf_dcbx_type, tvb, tempOffset, 1, ENC_BIG_ENDIAN); tempOffset++; - consumedLen++; /* One org specific OUI holds many DCBx TLVs */ while (tvb_reported_length_remaining(tvb, tempOffset) && tree) { @@ -1489,7 +1488,7 @@ dissect_dcbx_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint3 proto_tree_add_item(subtlv_tree, hf_dcbx_control_ack, tvb, tempOffset, 4, ENC_BIG_ENDIAN); - /*tempOffset +=4;*/ + tempOffset +=4; } else { /* Common to all feature TLVs */ proto_tree_add_item(subtlv_tree, hf_dcbx_feature_flag_enabled, tvb, tempOffset, 1, ENC_BIG_ENDIAN); @@ -1614,9 +1613,6 @@ dissect_dcbx_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint3 } } - /* Move to next TLV, each TLV is size (len + 2)*/ - consumedLen += (tempLen + 2); - tempOffset = offset + consumedLen; } return; |