]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- A bug was fixed where the length of a hostname was miscalculated, so that
authorDavid Hankins <dhankins@isc.org>
Thu, 6 Mar 2008 21:33:22 +0000 (21:33 +0000)
committerDavid Hankins <dhankins@isc.org>
Thu, 6 Mar 2008 21:33:22 +0000 (21:33 +0000)
  hosts were given odd-looking domain names ("foo.bar.ba.example.com").
  [ISC-Bugs #17732]

RELNOTES
common/options.c

index 731881ea5ce4f85dfc04b8b7d02856ded4207f7f..c33f416a009c7917fed08222a366fcb34d9b108d 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -61,6 +61,9 @@ work on other platforms. Please report any problems and suggested fixes to
   fsync()'s, it can be configured by the max-ack-delay configuration
   parameter.
 
+- A bug was fixed where the length of a hostname was miscalculated, so that
+  hosts were given odd-looking domain names ("foo.bar.ba.example.com").
+
                        Changes since 4.0.0 (new features)
 
 - Added DHCPv6 rapid commit support.
index e259cf7a4778dfa780e44a69678d9679fcdfb730..72b05863d586dcd1f982b21bf7a33c0addff9bbe 100644 (file)
@@ -3363,14 +3363,16 @@ fqdn6_universe_decode(struct option_state *options,
 
        /* Save the domain name. */
        if (len > 0) {
+               unsigned char *fqdn_start = bp->data + 3;
+
                if (!save_option_buffer(&fqdn_universe, options, bp,
-                                       bp->data + 3, len, FQDN_FQDN, 1))
+                                       fqdn_start, len, FQDN_FQDN, 1))
                        goto error;
 
-               first_dot = (unsigned char *)strchr((char *)bp->data + 3, '.');
+               first_dot = (unsigned char *)strchr((char *)fqdn_start, '.');
 
                if (first_dot != NULL) {
-                       hlen = first_dot - bp->data + 3;
+                       hlen = first_dot - fqdn_start;
                        dlen = len - hlen;
                } else {
                        hlen = len;
@@ -3378,14 +3380,14 @@ fqdn6_universe_decode(struct option_state *options,
                }
 
                if (!save_option_buffer(&fqdn_universe, options, bp,
-                                       bp->data + 3, len, FQDN_FQDN, 1) ||
+                                       fqdn_start, len, FQDN_FQDN, 1) ||
                    ((hlen > 0) &&
                     !save_option_buffer(&fqdn_universe, options, bp,
-                                        bp->data + 3, hlen,
+                                        fqdn_start, hlen,
                                         FQDN_HOSTNAME, 0)) ||
                    ((dlen > 0) &&
-                    !save_option_buffer(&fqdn_universe, options, bp, first_dot,
-                                        dlen, FQDN_DOMAINNAME, 0)))
+                    !save_option_buffer(&fqdn_universe, options, bp,
+                                        first_dot, dlen, FQDN_DOMAINNAME, 0)))
                                goto error;
        }