bootp: DHCP User Class Data iPXE exception
authorJaap Keuter <jaap.keuter@xs4all.nl>
Wed, 24 Jan 2018 14:32:25 +0000 (15:32 +0100)
committerAnders Broman <a.broman58@gmail.com>
Thu, 25 Jan 2018 05:18:47 +0000 (05:18 +0000)
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>
epan/dissectors/packet-bootp.c

index f0d941ef3d060fc7350ab895037d6316bf926330..1a9c517662d13dd8f1ccd976c7ea3fc4f9cc339a 100644 (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 }},