aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2017-08-25 13:50:42 +0200
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2017-08-26 08:19:17 +0000
commit50227b0f6efb9ef56ff8a7fa85a9d6011012a201 (patch)
treec414824edf0870d57a0b81a4fe6c178ab7851245
parent166d95e7cbe9b27b070ac03829f4d8add3a1945e (diff)
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 <a.broman58@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
-rw-r--r--epan/dissectors/packet-infiniband.c28
1 files 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}