diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-09-29 21:07:47 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-10-01 08:06:17 +0000 |
commit | 39c51be8ce1c4f8402d6122dee214f0557510e02 (patch) | |
tree | fb06f10cbed235061d898855f2f8b5e98b33c833 | |
parent | 41ef2b01cdacb3c2497906429de8ff3bd519fd4e (diff) |
LLDP: TIA Network Policy Unknown Policy Flag Decode is not correct
Wrong length for field...
Bug:10512
Change-Id: I416a34d5f50cc0e842612a084c95d885eea68ef1
Reviewed-on: https://code.wireshark.org/review/4377
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/packet-lldp.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/epan/dissectors/packet-lldp.c b/epan/dissectors/packet-lldp.c index ef5ad522a0..c874db2e4a 100644 --- a/epan/dissectors/packet-lldp.c +++ b/epan/dissectors/packet-lldp.c @@ -2412,38 +2412,28 @@ dissect_media_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 o tlvLen--; /* Get flags */ - if (tlvLen < 2) + if (tlvLen < 3) { proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length , tvb, offset, tlvLen); return; } - proto_tree_add_item(tree, hf_media_policy_flag, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(tree, hf_media_tag_flag, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_media_policy_flag, tvb, offset, 3, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_media_tag_flag, tvb, offset, 3, ENC_BIG_ENDIAN); /* Get vlan id */ - proto_tree_add_item(tree, hf_media_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_media_vlan_id, tvb, offset, 3, ENC_BIG_ENDIAN); - offset++; - tlvLen--; /* Get L2 priority */ - if (tlvLen < 1) - { - proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length , tvb, offset, tlvLen); - return; - } - - proto_tree_add_item(tree, hf_media_l2_prio, tvb, offset, 2, ENC_BIG_ENDIAN); - offset++; - tlvLen--; + proto_tree_add_item(tree, hf_media_l2_prio, tvb, offset, 3, ENC_BIG_ENDIAN); /* Get DSCP value */ - proto_tree_add_item(tree, hf_media_dscp, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_media_dscp, tvb, offset, 3, ENC_BIG_ENDIAN); - offset++; - tlvLen--; + offset += 3; + tlvLen -= 3; break; } case 3: /* Location Identification */ |