From: Thomas Markwalder Date: Thu, 20 Jun 2019 14:15:47 +0000 (-0400) Subject: [v4_1_esv] Ignore empty host name option when parsing v4 packets X-Git-Tag: v4_1_esv_r16b1~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d033337751e994a6a1bbfb64ade6460e69fed420;p=thirdparty%2Fdhcp.git [v4_1_esv] Ignore empty host name option when parsing v4 packets Merges in rt43786 --- diff --git a/RELNOTES b/RELNOTES index 4eadf7674..904566043 100644 --- a/RELNOTES +++ b/RELNOTES @@ -78,6 +78,12 @@ dhcp-users@lists.isc.org. even valid values to fail as invalid on some environments. [ISC-Bugs #46535] +- Added to code ignore empty IPv4 host name option (code 12). While RFC 2132 + states the option cannot be empty, some clients are apparently capable of + sending it. Prior to this the server was attempting to use it and store it + in the lease file causing issues with DDNS and so forth. + [ISC-bugs #43786] + Changes since 4.1-ESV-R15b1 - None diff --git a/common/options.c b/common/options.c index cd232284e..a136cd5c5 100644 --- a/common/options.c +++ b/common/options.c @@ -187,6 +187,14 @@ int parse_option_buffer (options, buffer, length, universe) return 0; } + if (universe == &dhcp_universe && code == DHO_HOST_NAME && + len == 0) { + /* non-compliant clients can send it + * we'll just drop it and go on */ + log_debug ("Ignoring empty DHO_HOST_NAME option"); + option_dereference(&option, MDL); + } + /* If the option contains an encapsulation, parse it. If the parse fails, or the option isn't an encapsulation (by far the most common case), or the option isn't entirely