forked from osmocom/wireshark
Fix IP Security option dissection
"offset" no longer needed (since using dissector table for options), and since it should always be 0, just remove it. Change-Id: Icc2802b76bc99a17d60d1deff75e1dc65761e8ed Reviewed-on: https://code.wireshark.org/review/22848 Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
parent
c50945989d
commit
e3b46bc48a
|
@ -859,8 +859,7 @@ dissect_ipopt_security(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
|
||||||
proto_item *tf;
|
proto_item *tf;
|
||||||
guint val;
|
guint val;
|
||||||
guint curr_offset = 2;
|
guint curr_offset = 2;
|
||||||
guint offset = 2,
|
guint optlen = tvb_reported_length(tvb);
|
||||||
optlen = tvb_reported_length(tvb);
|
|
||||||
|
|
||||||
field_tree = ip_var_option_header(tree, pinfo, tvb, proto_ip_option_security, ett_ip_option_sec, &tf, optlen);
|
field_tree = ip_var_option_header(tree, pinfo, tvb, proto_ip_option_security, ett_ip_option_sec, &tf, optlen);
|
||||||
|
|
||||||
|
@ -888,7 +887,7 @@ dissect_ipopt_security(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
|
||||||
/* Dissect as RFC 108 */
|
/* Dissect as RFC 108 */
|
||||||
proto_tree_add_item(field_tree, hf_ip_opt_sec_cl, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
|
proto_tree_add_item(field_tree, hf_ip_opt_sec_cl, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
|
||||||
curr_offset++;
|
curr_offset++;
|
||||||
if ((curr_offset - offset) >= optlen) {
|
if (curr_offset >= optlen) {
|
||||||
return curr_offset;
|
return curr_offset;
|
||||||
}
|
}
|
||||||
val = tvb_get_guint8(tvb, curr_offset);
|
val = tvb_get_guint8(tvb, curr_offset);
|
||||||
|
@ -897,7 +896,7 @@ dissect_ipopt_security(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
|
||||||
ENC_BIG_ENDIAN);
|
ENC_BIG_ENDIAN);
|
||||||
curr_offset++;
|
curr_offset++;
|
||||||
while (val & 0x01) {
|
while (val & 0x01) {
|
||||||
if ((val & 0x01) && ((curr_offset - offset) == optlen)) {
|
if ((val & 0x01) && (curr_offset == optlen)) {
|
||||||
expert_add_info(pinfo, tf, &ei_ip_opt_sec_prot_auth_fti);
|
expert_add_info(pinfo, tf, &ei_ip_opt_sec_prot_auth_fti);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -907,7 +906,7 @@ dissect_ipopt_security(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
|
||||||
ENC_BIG_ENDIAN);
|
ENC_BIG_ENDIAN);
|
||||||
curr_offset++;
|
curr_offset++;
|
||||||
}
|
}
|
||||||
if ((curr_offset - offset) < optlen) {
|
if (curr_offset < optlen) {
|
||||||
expert_add_info(pinfo, tf, &ei_ip_extraneous_data);
|
expert_add_info(pinfo, tf, &ei_ip_extraneous_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue