diff options
author | Adam Goldman <adam.goldman@intel.com> | 2016-06-02 15:34:48 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-06-04 12:37:23 +0000 |
commit | c72c7d792a9b3202bcef7b5a223abe5fcb1d58a9 (patch) | |
tree | 8cdaa51a9d697868a8f8423a46282d85d45b4419 /epan | |
parent | a6618ffdc9ed8ad28aeecf902b45c39e2f3b9d93 (diff) |
opa: Fix LIDs not being byte swapped
Change-Id: I897099bf9f6ee38d0ec9a7a5e9fb3bba43b5fe0f
Reviewed-on: https://code.wireshark.org/review/15704
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Adam Goldman <adam.goldman@intel.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-opa.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/epan/dissectors/packet-opa.c b/epan/dissectors/packet-opa.c index d19cc5841a..4b4c71eb80 100644 --- a/epan/dissectors/packet-opa.c +++ b/epan/dissectors/packet-opa.c @@ -498,6 +498,7 @@ static void parse_opa_9B_Header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t /* 16B - L2 Header */ proto_item *L2_9B_header_item; proto_tree *L2_9B_header_tree; + void *src_addr, *dst_addr; gint local_offset = *offset; @@ -520,7 +521,9 @@ static void parse_opa_9B_Header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t proto_tree_add_item(L2_9B_header_tree, hf_opa_9B_dlid, tvb, local_offset, 2, ENC_BIG_ENDIAN); /* Set destination in packet view. */ - set_address_tvb(&pinfo->dst, AT_IB, 2, tvb, local_offset); + dst_addr = wmem_alloc(pinfo->pool, sizeof(guint16)); + *((guint16 *)dst_addr) = tvb_get_ntohs(tvb, local_offset); + set_address(&pinfo->dst, AT_IB, sizeof(guint16), dst_addr); local_offset += 2; proto_tree_add_item(L2_9B_header_tree, hf_opa_9B_reserved3, tvb, local_offset, 1, ENC_BIG_ENDIAN); @@ -530,7 +533,9 @@ static void parse_opa_9B_Header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t proto_tree_add_item(L2_9B_header_tree, hf_opa_9B_slid, tvb, local_offset, 2, ENC_BIG_ENDIAN); /* Set Source in packet view. */ - set_address_tvb(&pinfo->src, AT_IB, 2, tvb, local_offset); + src_addr = wmem_alloc(pinfo->pool, sizeof(guint16)); + *((guint16 *)src_addr) = tvb_get_ntohs(tvb, local_offset); + set_address(&pinfo->src, AT_IB, sizeof(guint16), src_addr); local_offset += 2; *offset = local_offset; |