bootp: DHCP User Class Data iPXE exception

iPXE seems to violate RFC 3004 by ommitting the UC_Len_i field in the
User Class Data field. Since this seems to be a 'well known' issue,
which is not going to be corrected, detect and circumvent the error
detection for this specific use.

Bug: 14312
Change-Id: I2a15c336d7f67ee5fd83f955de7126eac146bfb1
Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-on: https://code.wireshark.org/review/25450
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Jaap Keuter 2018-01-24 15:32:25 +01:00 committed by Anders Broman
parent 369f8195e8
commit 55fbeec607
1 changed files with 9 additions and 0 deletions

View File

@ -618,6 +618,7 @@ static expert_field ei_bootp_option125_enterprise_malformed = EI_INIT;
static expert_field ei_bootp_option_6RD_malformed = EI_INIT;
static expert_field ei_bootp_option82_vi_cl_tag_unknown = EI_INIT;
static expert_field ei_bootp_option_parse_err = EI_INIT;
static expert_field ei_bootp_nonstd_option_data = EI_INIT;
static expert_field ei_bootp_suboption_invalid = EI_INIT;
static expert_field ei_bootp_secs_le = EI_INIT;
static expert_field ei_bootp_end_option_missing = EI_INIT;
@ -2190,6 +2191,13 @@ dissect_bootpopt_user_class_information(tvbuff_t *tvb, packet_info *pinfo, proto
return 1;
}
if (!tvb_strneql(tvb, offset, "iPXE", 4)) {
/* The iPXE is known to violate RFC 3004, http://forum.ipxe.org/showthread.php?tid=7530 */
proto_item *expert_ti = proto_tree_add_item(tree, hf_bootp_option77_user_class_data, tvb, offset, -1, ENC_NA);
expert_add_info(pinfo, expert_ti, &ei_bootp_nonstd_option_data);
return tvb_captured_length(tvb);
}
while (tvb_reported_length_remaining(tvb, offset) > 0) {
/* Create subtree for instance of User Class. */
vtix = proto_tree_add_uint_format_value(tree, hf_bootp_option77_user_class,
@ -8861,6 +8869,7 @@ proto_register_bootp(void)
{ &ei_bootp_option_6RD_malformed, { "bootp.option.6RD.malformed", PI_PROTOCOL, PI_ERROR, "6RD: malformed option", EXPFILL }},
{ &ei_bootp_option82_vi_cl_tag_unknown, { "bootp.option.option.vi.cl.tag_unknown", PI_PROTOCOL, PI_ERROR, "Unknown tag", EXPFILL }},
{ &ei_bootp_option_parse_err, { "bootp.option.parse_err", PI_PROTOCOL, PI_ERROR, "Parse error", EXPFILL }},
{ &ei_bootp_nonstd_option_data, { "bootp.option.nonstd_data", PI_PROTOCOL, PI_NOTE, "Non standard compliant option data", EXPFILL }},
{ &ei_bootp_suboption_invalid, { "bootp.suboption_invalid", PI_PROTOCOL, PI_ERROR, "Invalid suboption", EXPFILL }},
{ &ei_bootp_secs_le, { "bootp.secs_le", PI_PROTOCOL, PI_NOTE, "Seconds elapsed appears to be encoded as little-endian", EXPFILL }},
{ &ei_bootp_end_option_missing, { "bootp.end_option_missing", PI_PROTOCOL, PI_ERROR, "End option missing", EXPFILL }},