aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorBasak Kalfa <basakkalfa@gmail.com>2019-11-20 04:21:25 -0800
committerRoland Knall <rknall@gmail.com>2019-11-20 14:32:55 +0000
commit1859b35f5a7231ba538263c1dab6f6ad221cb91f (patch)
tree3e928067885d5d86aee8d52e6acce8a31b8bc2b9 /plugins
parent4dacdd9ff0965a069f3c52fc00ea08288dfb7b0d (diff)
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>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/epan/profinet/packet-dcerpc-pn-io.c9
-rw-r--r--plugins/epan/profinet/packet-pn-rt.c2
2 files changed, 7 insertions, 4 deletions
diff --git a/plugins/epan/profinet/packet-dcerpc-pn-io.c b/plugins/epan/profinet/packet-dcerpc-pn-io.c
index 6641119ff7..9f32d53f34 100644
--- a/plugins/epan/profinet/packet-dcerpc-pn-io.c
+++ b/plugins/epan/profinet/packet-dcerpc-pn-io.c
@@ -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);
diff --git a/plugins/epan/profinet/packet-pn-rt.c b/plugins/epan/profinet/packet-pn-rt.c
index 7bb5c09961..426b722c42 100644
--- a/plugins/epan/profinet/packet-pn-rt.c
+++ b/plugins/epan/profinet/packet-pn-rt.c
@@ -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" },