Fix endianness of CAN-ETH CAN packet

The CAN-ETH protocol explicitly states that the CAN identifiers are
transmitted in little-endian order, and the dissector now decodes it as
little-endian rather than host-endian.

Change-Id: I92c44b809caace31726e0d355363355eb32efa3e
Reviewed-on: https://code.wireshark.org/review/25549
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Lazar Sumar 2018-02-01 16:17:04 +00:00 committed by Michael Mann
parent 142c03516e
commit d7be8465b9
1 changed files with 1 additions and 2 deletions

View File

@ -96,14 +96,13 @@ dissect_caneth_can(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
can_tree = proto_item_add_subtree(ti, ett_caneth_can);
ext_flag = tvb_get_guint8(tvb, 13);
proto_tree_add_item_ret_uint(can_tree, hf_caneth_can_ident_ext, tvb, 0, 4, ENC_LITTLE_ENDIAN, &raw_can_id);
if (ext_flag)
{
proto_tree_add_item_ret_uint(can_tree, hf_caneth_can_ident_ext, tvb, 0, 4, ENC_NA, &raw_can_id);
can_id.id = raw_can_id & CAN_EFF_MASK;
}
else
{
proto_tree_add_item_ret_uint(can_tree, hf_caneth_can_ident_std, tvb, 0, 4, ENC_NA, &raw_can_id);
can_id.id = raw_can_id & CAN_SFF_MASK;
}