CIP: Correct DATE_AND_TIME parsing

DATE_AND_TIME struct is actually time then date. We were previously
parsing it as date then time.

Change-Id: I7367b5502318de32b7c9e7fd170ae58de4c3347f
Reviewed-on: https://code.wireshark.org/review/31431
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Dylan Ulis 2019-01-06 19:31:31 -05:00 committed by Anders Broman
parent 52747f466e
commit e313b25359
2 changed files with 5 additions and 5 deletions

View File

@ -5244,8 +5244,8 @@ void dissect_cip_date_and_time(proto_tree *tree, tvbuff_t *tvb, int offset, int
guint16 num_days_since_1972;
guint32 num_ms_today;
num_days_since_1972 = tvb_get_letohs( tvb, offset);
num_ms_today = tvb_get_letohl( tvb, offset+2 );
num_days_since_1972 = tvb_get_letohs(tvb, offset+4);
num_ms_today = tvb_get_letohl(tvb, offset);
if ((num_days_since_1972 != 0) || (num_ms_today != 0))
{

View File

@ -472,7 +472,7 @@ void dissect_cipsafety_ssn(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _
{
guint16 date;
date = tvb_get_letohs( tvb, offset);
date = tvb_get_letohs(tvb, offset+4);
if ((date >= 11688) && (date <= 65534))
{
@ -482,8 +482,8 @@ void dissect_cipsafety_ssn(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _
else
{
/* Treated as UINT16 and UINT32 values */
proto_tree_add_item(tree, hf_date, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_time, tvb, offset+2, 4, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_date, tvb, offset + 4, 2, ENC_LITTLE_ENDIAN);
}
}