]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master] Ignore empty host name option when parsing v4 packets
authorThomas Markwalder <tmark@isc.org>
Mon, 27 Nov 2017 18:50:02 +0000 (13:50 -0500)
committerThomas Markwalder <tmark@isc.org>
Mon, 27 Nov 2017 18:50:02 +0000 (13:50 -0500)
    Merges in rt43786

RELNOTES
common/options.c

index 744c032c2041c6f7deaecf1b05e2daef6db50f1c..77c0abb7642e93bb364400fe5f7962dc6349e7fa 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -1168,6 +1168,12 @@ dhcp-users@lists.isc.org.
   with implicit function declarations errors for POST() and INSIST().
   [ISC-bugs #46332]
 
+- 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.2.0 (new features)
 
 - If a client renews before 'dhcp-cache-threshold' percent of its lease
index 78f85f796ccc5cf752703e164ae34903ec3a7fcd..ae5b2844d27bdeb6bd477b44b2c872a4a2dc560c 100644 (file)
@@ -202,6 +202,16 @@ int parse_option_buffer (options, buffer, length, universe)
                                                             universe, NULL);
                }
 
+               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);
+                       offset += len;
+                       continue;
+               }
+
                op = lookup_option(universe, options, code);
                if (op == NULL) {
                        /* If we don't have an option create one */