From: Roy Marples Date: Wed, 30 Jul 2014 08:58:42 +0000 (+0000) Subject: Only bits 1 and 2 are used in the DHCP overload option, so when we encounter X-Git-Tag: v6.4.3~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f53e7bdce8527d4879102f8953f486ef6dd8c5eb;p=thirdparty%2Fdhcpcd.git Only bits 1 and 2 are used in the DHCP overload option, so when we encounter the option set the last bit as well to ensure servername and bootfile are only checked once as their check unsets bits 1 and 2. Thanks to Tobias Stoeckmann. --- diff --git a/dhcp.c b/dhcp.c index fefb549d..13a57592 100644 --- a/dhcp.c +++ b/dhcp.c @@ -203,9 +203,12 @@ get_option(struct dhcpcd_ctx *ctx, goto exit; break; case DHO_OPTIONSOVERLOADED: - /* Ensure we only get this option once */ + /* Ensure we only get this option once by setting + * the last bit as well as the value. + * This is valid because only the first two bits + * actually mean anything in RFC2132 Section 9.3 */ if (!overl) - overl = p[1]; + overl = 0x80 | p[1]; break; } l = *p++;