aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-hip.c
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2012-04-19 12:41:12 +0000
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2012-04-19 12:41:12 +0000
commit990d1ad71e2a28231f93a622cb93fe5e38a9bf84 (patch)
treec066b56bf8caec5c2573d76c1dcde3dbab7f261b /epan/dissectors/packet-hip.c
parent61a6d25bc29aadbba91d91bc387d2d9293a0db6e (diff)
From Francisco Vidal Meca via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7136
HIP dissector: PUZZLE and SOLUTION parameters variable size According to specifications, puzzle and solution parameters carry Random #I and #J fields that has variable length depending of the Hash function. The fields are recognized with a fixed value of 8 bytes. The #I and #J fields should be determined depending of the TLV size. See http://tools.ietf.org/html/draft-ietf-hip-rfc5201-bis-08#section-5.2.5 . svn path=/trunk/; revision=42140
Diffstat (limited to 'epan/dissectors/packet-hip.c')
-rw-r--r--epan/dissectors/packet-hip.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-hip.c b/epan/dissectors/packet-hip.c
index 7a64ebdf3e..fc9ed8e4bd 100644
--- a/epan/dissectors/packet-hip.c
+++ b/epan/dissectors/packet-hip.c
@@ -748,7 +748,7 @@ dissect_hip_tlv(tvbuff_t *tvb, int offset, proto_item *ti, int type, int tlv_len
proto_tree_add_item(t, hf_hip_tlv_puzzle_o, tvb, newoffset, 2, ENC_BIG_ENDIAN);
/* Puzzle I */
newoffset += 2;
- proto_tree_add_item(t, hf_hip_tlv_puzzle_i, tvb,newoffset, 8, ENC_NA);
+ proto_tree_add_item(t, hf_hip_tlv_puzzle_i, tvb,newoffset, tlv_len - 4, ENC_NA);
break;
case PARAM_SOLUTION:
t = proto_item_add_subtree(ti, ett_hip_tlv_data);
@@ -762,10 +762,10 @@ dissect_hip_tlv(tvbuff_t *tvb, int offset, proto_item *ti, int type, int tlv_len
proto_tree_add_item(t, hf_hip_tlv_solution_o, tvb,newoffset, 2, ENC_BIG_ENDIAN);
/* Solution I */
newoffset += 2;
- proto_tree_add_item(t, hf_hip_tlv_solution_i, tvb, newoffset, 8, ENC_NA);
+ proto_tree_add_item(t, hf_hip_tlv_solution_i, tvb, newoffset, (tlv_len - 4)/2, ENC_NA);
/* Solution J */
- newoffset += 8;
- proto_tree_add_item(t, hf_hip_tlv_solution_j, tvb, newoffset, 8, ENC_NA);
+ newoffset += (tlv_len - 4) /2;
+ proto_tree_add_item(t, hf_hip_tlv_solution_j, tvb, newoffset, (tlv_len -4)/2, ENC_NA);
break;
case PARAM_SEQ:
t = proto_item_add_subtree(ti, ett_hip_tlv_data);