PROFINET: Fix related to redundancy and PNIOStatus

According to specification, redundancy bit values in
packet-pn-rt.c are swapped. Moreover, endpoint type
was changed by Change 30821 and became ENDPOINT_NONE.
It has caused an error since related conversation can
not be found with its endpoint (ENDPOINT_UDP). Finally,
it is detected that when PNIOStatus is error, dissection
still continues but there is no data to dissect. This
defect is also fixed by this commit. (This change also
includes one fix for dead store.)

Change-Id: I09a07fd0027c4485ba84651e969b3de9d0012b5c
Reviewed-on: https://code.wireshark.org/review/35158
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
This commit is contained in:
Basak Kalfa 2019-11-20 04:21:25 -08:00 committed by Roland Knall
parent 4dacdd9ff0
commit 1859b35f5a
2 changed files with 7 additions and 4 deletions

View File

@ -7622,7 +7622,7 @@ dissect_ARBlockReq_block(tvbuff_t *tvb, int offset,
/* Create new conversation, if no "Ident OK" frame as been dissected yet!
* Need to switch dl_src & dl_dst, as current packet is sent by controller and not by device.
* All conversations are based on Device MAC as addr1 */
conversation = conversation_new(pinfo->num, &pinfo->dl_dst, &pinfo->dl_src, ENDPOINT_NONE, 0, 0, 0);
conversation = conversation_new(pinfo->num, &pinfo->dl_dst, &pinfo->dl_src, ENDPOINT_UDP, 0, 0, 0);
}
/* Try to get apdu status switch information from the conversation */
@ -10305,8 +10305,7 @@ dissect_RecordDataRead(tvbuff_t *tvb, int offset,
/* user specified format? */
if (u16Index < 0x8000) {
offset = dissect_pn_user_data(tvb, offset, pinfo, tree, u32RecDataLen, "User Specified Data");
return offset;
return dissect_pn_user_data(tvb, offset, pinfo, tree, u32RecDataLen, "User Specified Data");
}
/* profidrive parameter access response */
@ -10493,6 +10492,10 @@ dissect_IPNIO_Read_resp(tvbuff_t *tvb, int offset,
offset = dissect_IPNIO_resp_header(tvb, offset, pinfo, tree, di, drep);
/* When PNIOStatus is Error */
if (!tvb_captured_length_remaining(tvb, offset))
return offset;
/* IODReadHeader */
offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);

View File

@ -127,7 +127,7 @@ static const value_string pn_rt_frame_info_function_meaning_output_conv[] = {
};
static const true_false_string tfs_pn_rt_ds_redundancy =
{"Redundancy has no meaning for OutputCRs / One primary AR of a given AR-set is present" , "None primary AR of a given AR-set is present" };
{ "None primary AR of a given AR-set is present", "Redundancy has no meaning for OutputCRs / One primary AR of a given AR-set is present" };
static const value_string pn_rt_frag_status_error[] = {
{ 0x00, "reserved" },