oampdu: Fix DPoE get request parsing

This commit is contained in:
Arkady Gilinsky 2021-07-13 06:51:15 +00:00 committed by AndersBroman
parent fa9ee0f37a
commit 054868cb0e
1 changed files with 14 additions and 2 deletions

View File

@ -1669,6 +1669,8 @@ dissect_oampdu_vendor_specific(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
proto_tree *oampdu_vendor_specific_tree;
proto_tree *dpoe_opcode_tree;
proto_item *dpoe_opcode_item;
proto_item *dpoe_opcode_request_tree;
proto_item *dpoe_opcode_request_item;
proto_item *dpoe_opcode_response;
proto_tree *dpoe_opcode_response_tree;
offset = OAMPDU_HEADER_SIZE;
@ -1693,14 +1695,24 @@ dissect_oampdu_vendor_specific(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
break;
case DPOE_OPCODE_GET_REQUEST:
leaf_branch = tvb_get_ntoh24(tvb, offset);
variable_length = 0;
if (leaf_branch == DPOE_LB_ONU_OBJ || leaf_branch == DPOE_LB_LINK_OBJ || leaf_branch == DPOE_LB_USER_PORT_OBJ) {
proto_tree_add_item(dpoe_opcode_tree, hf_dpoe_variable_descriptor, tvb, offset, 3, ENC_BIG_ENDIAN);
dpoe_opcode_request_item = proto_tree_add_item(dpoe_opcode_tree, hf_dpoe_variable_descriptor, tvb, offset, 3, ENC_BIG_ENDIAN);
offset += 3;
variable_length = tvb_get_guint8(tvb, offset);
offset += 1;
offset += variable_length;
if (variable_length == 1) {
/* Add User Port or Link instance */
dpoe_opcode_request_tree = proto_item_add_subtree(dpoe_opcode_request_item, ett_dpoe_opcode);
if (leaf_branch == DPOE_LB_USER_PORT_OBJ) {
proto_tree_add_item(dpoe_opcode_request_tree, hf_oam_dpoe_user_port_object, tvb, offset, 1, ENC_BIG_ENDIAN);
} else {
proto_tree_add_item(dpoe_opcode_request_tree, hf_oampdu_variable_value, tvb, offset, 1, ENC_NA);
}
}
}
next_byte = tvb_get_guint8(tvb, offset);
offset += variable_length;
while (next_byte != 0x00) {
proto_tree_add_item(dpoe_opcode_tree, hf_dpoe_variable_descriptor, tvb, offset, 3, ENC_BIG_ENDIAN);
offset += 3;