From 50227b0f6efb9ef56ff8a7fa85a9d6011012a201 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Fri, 25 Aug 2017 13:50:42 +0200 Subject: infiniband: fix infiniband: sIP and dIP inside IP CM Private Data are decoded in the wrong order Issue reported by Yao Lin Bug: 14002 Change-Id: Ib49f74edbaac4830340fb9d7dba5105f0bdeb2f1 Reviewed-on: https://code.wireshark.org/review/23200 Reviewed-by: Anders Broman Petri-Dish: Anders Broman Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte --- epan/dissectors/packet-infiniband.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/epan/dissectors/packet-infiniband.c b/epan/dissectors/packet-infiniband.c index 19d55c3261..098942cd98 100644 --- a/epan/dissectors/packet-infiniband.c +++ b/epan/dissectors/packet-infiniband.c @@ -628,10 +628,10 @@ static int hf_cm_req_ip_cm_minv = -1; static int hf_cm_req_ip_cm_ipv = -1; static int hf_cm_req_ip_cm_res = -1; static int hf_cm_req_ip_cm_sport = -1; -static int hf_cm_req_ip_cm_dip6 = -1; static int hf_cm_req_ip_cm_sip6 = -1; -static int hf_cm_req_ip_cm_dip4 = -1; +static int hf_cm_req_ip_cm_dip6 = -1; static int hf_cm_req_ip_cm_sip4 = -1; +static int hf_cm_req_ip_cm_dip4 = -1; static int hf_ip_cm_req_consumer_private_data = -1; /* CM REP Header */ @@ -3147,15 +3147,15 @@ static void parse_IP_CM_Req_Msg(proto_tree *parent_tree, tvbuff_t *tvb, gint loc local_offset += 2; if (ipv == 4) { - /* skip first 12 bytes of zero for dip */ - proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_dip4, tvb, local_offset + 12, 4, ENC_NA); - local_offset += 16; /* skip first 12 bytes of zero for sip */ proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_sip4, tvb, local_offset + 12, 4, ENC_NA); - } else { - proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_dip6, tvb, local_offset, 16, ENC_NA); local_offset += 16; + /* skip first 12 bytes of zero for dip */ + proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_dip4, tvb, local_offset + 12, 4, ENC_NA); + } else { proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_sip6, tvb, local_offset, 16, ENC_NA); + local_offset += 16; + proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_dip6, tvb, local_offset, 16, ENC_NA); } local_offset += 16; @@ -6111,22 +6111,22 @@ void proto_register_infiniband(void) "IP CM Source Port", "infiniband.cm.req.ip_cm.sport", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL} }, - {&hf_cm_req_ip_cm_dip6, { - "IP CM Destination IP", "infiniband.cm.req.ip_cm.dip6", - FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL} - }, {&hf_cm_req_ip_cm_sip6, { "IP CM Source IP", "infiniband.cm.req.ip_cm.sip6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL} }, - {&hf_cm_req_ip_cm_dip4, { - "IP CM Destination IP", "infiniband.cm.req.ip_cm.dip4", - FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL} + {&hf_cm_req_ip_cm_dip6, { + "IP CM Destination IP", "infiniband.cm.req.ip_cm.dip6", + FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL} }, {&hf_cm_req_ip_cm_sip4, { "IP CM Source IP", "infiniband.cm.req.ip_cm.sip4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL} }, + {&hf_cm_req_ip_cm_dip4, { + "IP CM Destination IP", "infiniband.cm.req.ip_cm.dip4", + FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL} + }, {&hf_ip_cm_req_consumer_private_data, { "IP CM Consumer PrivateData", "infiniband.cm.req.ip_cm.private", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} -- cgit v1.2.3