diff options
author | Michalis Kapsalakis <kapsalis1989@gmail.com> | 2018-04-22 13:35:18 +0200 |
---|---|---|
committer | Dario Lombardo <lomato@gmail.com> | 2018-04-22 19:50:57 +0000 |
commit | e863ece7fcceeb8b18001824146d3c7dabe19924 (patch) | |
tree | 207074c2ff08dd496c210951500b513fd43faf12 /plugins/epan/ethercat/packet-ecatmb.c | |
parent | 826e0d5d9e064a13d00406d7b4de47ba80b9e6a0 (diff) |
EtherCAT: Fix small bugs for mailbox type
This commit fixes the bug in the EtherCAT dissector for the FoE
mailbox type. With this commit, the dissector displays the
either foe_efw or foe_data in the ECAT_FOE_OPMODE_DATA,
and not both of them as until now.
Bug: 14613
Change-Id: I09fc569f5adc5665c64653087c475f7f1d94639a
Reviewed-on: https://code.wireshark.org/review/25336
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Diffstat (limited to 'plugins/epan/ethercat/packet-ecatmb.c')
-rw-r--r-- | plugins/epan/ethercat/packet-ecatmb.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/epan/ethercat/packet-ecatmb.c b/plugins/epan/ethercat/packet-ecatmb.c index 5664dde4e9..be8baccb01 100644 --- a/plugins/epan/ethercat/packet-ecatmb.c +++ b/plugins/epan/ethercat/packet-ecatmb.c @@ -1091,7 +1091,7 @@ static void dissect_ecat_foe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro anItem = proto_tree_add_bytes_format(tree, hf_ecat_mailbox_foe, tvb, offset, foe_length, NULL, "Foe"); aparent = proto_item_get_parent(anItem); - proto_item_append_text(aparent,"FoE "); + proto_item_append_text(aparent,": FoE"); } if( foe_length >= ETHERCAT_FOE_HEADER_LEN ) @@ -1123,8 +1123,6 @@ static void dissect_ecat_foe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_packetno, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=4; /*+2 for Reserved2*/ - proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_data, tvb, offset, foe_length-offset, ENC_NA); - if( foe_length-offset >= sizeof(TEFWUPDATE_HEADER) ) { anItem = proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_efw, tvb, offset, foe_length-offset, ENC_NA); @@ -1143,6 +1141,10 @@ static void dissect_ecat_foe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro proto_tree_add_item(ecat_foe_efw_tree, hf_ecat_mailbox_foe_efw_data, tvb, offset, foe_length-offset, ENC_NA); } + else + { + proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_data, tvb, offset, foe_length-offset, ENC_NA); + } } break; |