diff options
author | nakarlsson <se.nakarlsson@gmail.com> | 2018-11-28 12:51:56 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-11-30 11:25:59 +0000 |
commit | 26fe83e1db8b35ad07370ef2307324cc273a4f1d (patch) | |
tree | 61a0867d53010572b998a69337d06707dd68aae5 /plugins/epan/profinet/packet-dcerpc-pn-io.c | |
parent | dd457b08783e89e36e6e9e886438b7d7602c66fb (diff) | |
download | wireshark-26fe83e1db8b35ad07370ef2307324cc273a4f1d.tar.gz wireshark-26fe83e1db8b35ad07370ef2307324cc273a4f1d.tar.bz2 wireshark-26fe83e1db8b35ad07370ef2307324cc273a4f1d.zip |
PROFINET: fix dissection of IO conversasion direction
Bug: 15313
Change-Id: I5255f8b03f9d86cd7da8be34a71f0a3932bfca5c
Reviewed-on: https://code.wireshark.org/review/30821
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'plugins/epan/profinet/packet-dcerpc-pn-io.c')
-rw-r--r-- | plugins/epan/profinet/packet-dcerpc-pn-io.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/plugins/epan/profinet/packet-dcerpc-pn-io.c b/plugins/epan/profinet/packet-dcerpc-pn-io.c index e20c84a321..e2f34b7822 100644 --- a/plugins/epan/profinet/packet-dcerpc-pn-io.c +++ b/plugins/epan/profinet/packet-dcerpc-pn-io.c @@ -7653,10 +7653,10 @@ dissect_ARBlockReq_block(tvbuff_t *tvb, int offset, /* Get current conversation endpoints using MAC addresses */ conversation = find_conversation(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, ENDPOINT_UDP, 0, 0, 0); if (conversation == NULL) { - /* If conversation is null, then create new conversation */ - /* Connect Request is sent by controller and not by device. */ - /* All conversations are based on Controller MAC as address */ - conversation = conversation_new(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, ENDPOINT_UDP, 0, 0, 0); + /* 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); } /* Try to get apdu status switch information from the conversation */ @@ -8672,7 +8672,10 @@ dissect_DataDescription(tvbuff_t *tvb, int offset, /* Get current conversation endpoints using MAC addresses */ conversation = find_conversation(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, ENDPOINT_NONE, 0, 0, 0); if (conversation == NULL) { - conversation = conversation_new(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, ENDPOINT_NONE, 0, 0, 0); + /* 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); } station_info = (stationInfo*)conversation_get_proto_data(conversation, proto_pn_dcp); @@ -8804,7 +8807,10 @@ dissect_ExpectedSubmoduleBlockReq_block(tvbuff_t *tvb, int offset, /* Get current conversation endpoints using MAC addresses */ conversation = find_conversation(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, ENDPOINT_NONE, 0, 0, 0); if (conversation == NULL) { - conversation = conversation_new(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, ENDPOINT_NONE, 0, 0, 0); + /* 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); } station_info = (stationInfo*)conversation_get_proto_data(conversation, proto_pn_dcp); @@ -10656,7 +10662,10 @@ dissect_ProfiSafeParameterRequest(tvbuff_t *tvb, int offset, /* Get current conversation endpoints using MAC addresses */ conversation = find_conversation(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, ENDPOINT_NONE, 0, 0, 0); if (conversation == NULL) { - conversation = conversation_new(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, ENDPOINT_NONE, 0, 0, 0); + /* 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); } station_info = (stationInfo*)conversation_get_proto_data(conversation, proto_pn_dcp); @@ -10721,7 +10730,10 @@ dissect_RecordDataWrite(tvbuff_t *tvb, int offset, /* Get current conversation endpoints using MAC addresses */ conversation = find_conversation(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, ENDPOINT_NONE, 0, 0, 0); if (conversation == NULL) { - conversation = conversation_new(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, ENDPOINT_NONE, 0, 0, 0); + /* 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); } station_info = (stationInfo*)conversation_get_proto_data(conversation, proto_pn_dcp); |