- Validate the argument to the -p option.
+- The notorious 'option <unknown> ... larger than buffer' log line,
+ which is seen in some malformed DHCP client packets, was modified.
+ It now logs the universe name, and does not log the length values
+ (which are bogus corruption read from the packet anyway). It also
+ carries a hopefully more useful explanation.
+
Changes since 4.1.0b1
- A missing "else" in dhcrelay.c could have caused an interface not to
struct option_cache *op = NULL, *nop = NULL;
struct buffer *bp = (struct buffer *)0;
struct option *option = NULL;
+ char *reason = "general failure";
if (!buffer_allocate (&bp, length, MDL)) {
log_error ("no memory for option buffer.");
/* Don't look for length if the buffer isn't that big. */
if ((offset + universe->length_size) > length) {
- len = 65536;
+ reason = "code tag at end of buffer - missing "
+ "length field";
goto bogus;
}
/* If the length is outrageous, the options are bad. */
if (offset + len > length) {
+ reason = "option length exceeds option buffer length";
bogus:
- log_error ("parse_option_buffer: option %s (%u:%u) %s.",
- option ? option->name : "<unknown>",
- code, len, "larger than buffer");
+ log_error("parse_option_buffer: malformed option "
+ "%s.%s (code %u): %s.", universe->name,
+ option ? option->name : "<unknown>",
+ code, reason);
buffer_dereference (&bp, MDL);
return 0;
}