aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLazar Sumar <bugzilla@lazar.co.nz>2018-02-01 16:17:04 +0000
committerMichael Mann <mmann78@netscape.net>2018-02-01 18:19:37 +0000
commitd7be8465b9defa2a54946892dbc389d222ad2d1f (patch)
tree787eabe0e9f12501fea1ab5871a3e3bf81f00a54
parent142c03516ec93948ad30191730ace09baa57aa8d (diff)
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>
-rw-r--r--epan/dissectors/packet-caneth.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/epan/dissectors/packet-caneth.c b/epan/dissectors/packet-caneth.c
index 4208cbe5ae..04157d7afa 100644
--- a/epan/dissectors/packet-caneth.c
+++ b/epan/dissectors/packet-caneth.c
@@ -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;
}