diff options
author | Guy Harris <gharris@sonic.net> | 2024-02-11 22:33:22 -0800 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2024-02-11 22:33:22 -0800 |
commit | fdf4ecdb4aea61f6e557d75172d27ca0ffea79d7 (patch) | |
tree | 9187e5baf97d6dd37aa45b369859ed1dfb50a0db | |
parent | a313faaa42342cc50a1c6b718d25de3e5204918f (diff) |
socketcan: fetch the protocol/VCID field in the right byte order.
proto_tree_add_bitmask_list() is a bit of a pain if you want the values
of the field, so you have to fetch it yourself. It's little-endian, so
tvb_get_letohl(), not tvb_get_ntohl(), is the write routine to call.
-rw-r--r-- | epan/dissectors/packet-socketcan.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/dissectors/packet-socketcan.c b/epan/dissectors/packet-socketcan.c index af0c332008..6689900962 100644 --- a/epan/dissectors/packet-socketcan.c +++ b/epan/dissectors/packet-socketcan.c @@ -670,7 +670,7 @@ dissect_socketcan_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu guint32 proto_vcid; proto_tree_add_bitmask_list(can_tree, tvb, 0, 4, canxl_prio_vcid_fields, xl_encoding); - proto_vcid = tvb_get_ntohl(tvb, 0); + proto_vcid = tvb_get_letohl(tvb, 0); col_add_fstr(pinfo->cinfo, COL_INFO, "Priority: %u (0x%03x), VCID: %u (0x%02X)", proto_vcid & 0x7FF, proto_vcid & 0x7FF, (proto_vcid >> 16) & 0xFF, (proto_vcid >> 16) & 0xFF); proto_item_append_text(can_tree, ", Priority: %u (0x%03x), VCID: %u (0x%02X)", proto_vcid & 0x7FF, proto_vcid & 0x7FF, (proto_vcid >> 16) & 0xFF, (proto_vcid >> 16) & 0xFF); proto_tree_add_bitmask_list(can_tree, tvb, 4, 1, canxl_flag_fields, xl_encoding); |