aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2017-01-03 14:36:56 +0100
committerDario Lombardo <lomato@gmail.com>2017-01-03 15:02:41 +0000
commit564051df5e818cf4c9ad6447adebe466da03ae61 (patch)
tree0d62b3866f17b6b991f6ba061412613d75dc0919
parent8c86f3b0a386b6d13f56d3fbf6d9076bfa0419d2 (diff)
infiniband: remove offset variable.
Change-Id: Ie86c2aece05ebbc35eb15a54d8c3f2c455ff53cf Reviewed-on: https://code.wireshark.org/review/19516 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Dario Lombardo <lomato@gmail.com>
-rw-r--r--epan/dissectors/packet-infiniband.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/epan/dissectors/packet-infiniband.c b/epan/dissectors/packet-infiniband.c
index 3eda5abad4..768e76832f 100644
--- a/epan/dissectors/packet-infiniband.c
+++ b/epan/dissectors/packet-infiniband.c
@@ -2705,7 +2705,6 @@ static gboolean dissect_eth_over_ib(tvbuff_t *tvb, packet_info *pinfo, proto_tre
{
guint16 etype, reserved;
const char *saved_proto;
- volatile int offset = 0;
tvbuff_t *next_tvb;
struct infinibandinfo *info = (struct infinibandinfo *)data;
volatile gboolean dissector_found = FALSE;
@@ -2715,13 +2714,13 @@ static gboolean dissect_eth_over_ib(tvbuff_t *tvb, packet_info *pinfo, proto_tre
return FALSE;
}
- etype = tvb_get_ntohs(tvb, offset);
- reserved = tvb_get_ntohs(tvb, offset + 2);
+ etype = tvb_get_ntohs(tvb, 0);
+ reserved = tvb_get_ntohs(tvb, 2);
if (reserved != 0)
return FALSE;
- next_tvb = tvb_new_subset_remaining(tvb, offset+4);
+ next_tvb = tvb_new_subset_remaining(tvb, 4);
/* Look for sub-dissector, and call it if found.
Catch exceptions, so that if the reported length of "next_tvb"
@@ -2757,14 +2756,13 @@ static gboolean dissect_eth_over_ib(tvbuff_t *tvb, packet_info *pinfo, proto_tre
proto_tree *PAYLOAD_header_tree;
/* now create payload entry to show Ethertype */
- PAYLOAD_header_item = proto_tree_add_item(info->payload_tree, hf_infiniband_payload, tvb, offset, tvb_reported_length_remaining(tvb, offset)-6, ENC_NA);
+ PAYLOAD_header_item = proto_tree_add_item(info->payload_tree, hf_infiniband_payload, tvb, 0,
+ tvb_reported_length(tvb) - 6, ENC_NA);
proto_item_set_text(PAYLOAD_header_item, "%s", "IBA Payload - appears to be EtherType encapsulated");
PAYLOAD_header_tree = proto_item_add_subtree(PAYLOAD_header_item, ett_payload);
- proto_tree_add_item(PAYLOAD_header_tree, hf_infiniband_etype, tvb, offset, 2, ENC_BIG_ENDIAN);
- offset += 2;
- proto_tree_add_item(PAYLOAD_header_tree, hf_infiniband_reserved16_RWH, tvb, offset, 2, ENC_BIG_ENDIAN);
-
+ proto_tree_add_uint(PAYLOAD_header_tree, hf_infiniband_etype, tvb, 0, 2, etype);
+ proto_tree_add_uint(PAYLOAD_header_tree, hf_infiniband_reserved16_RWH, tvb, 2, 2, reserved);
}
return dissector_found;