]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[v4_1_esv] Ignore empty host name option when parsing v4 packets
authorThomas Markwalder <tmark@isc.org>
Thu, 20 Jun 2019 14:15:47 +0000 (10:15 -0400)
committerThomas Markwalder <tmark@isc.org>
Thu, 20 Jun 2019 14:15:47 +0000 (10:15 -0400)
        Merges in rt43786

RELNOTES
common/options.c

index 4eadf7674aeed0e4c3f7dfca05558647b4c03a79..904566043e0d3c07201e75ee520dd741aec711a4 100644 (file)
--- 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
index cd232284e3c735bd9bcb0c41fb833cb4f004a83d..a136cd5c5514136670dc12536242c4fc7888a6ce 100644 (file)
@@ -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