From: David Hankins Date: Thu, 6 Mar 2008 21:33:22 +0000 (+0000) Subject: - A bug was fixed where the length of a hostname was miscalculated, so that X-Git-Tag: v4_1_0a2~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8269561daa68024749ab4c46684ef080884754ba;p=thirdparty%2Fdhcp.git - 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"). [ISC-Bugs #17732] --- diff --git a/RELNOTES b/RELNOTES index 731881ea5..c33f416a0 100644 --- 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. diff --git a/common/options.c b/common/options.c index e259cf7a4..72b05863d 100644 --- a/common/options.c +++ b/common/options.c @@ -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; }