[Dnsmasq-discuss] Option 66 Bug?
dayton at voxter.ca
Fri Mar 26 23:38:16 GMT 2010
I am blown away not only by the explanation and fix/workaround, but that
nobody has ever tried doing a dhcp option where the IP started with a 7!
The workaround for me was to use a hostname, as all of the deployments that
this matter to me in are inside of DD-WRT router firmware, and unfortunately
I am unable to modify the code that produces the .conf file dnsmasq reads
from, so I am unable to make the change in their GUI to put the ³ in the new
spot, but, at least the hostname workaround worked.
Thanks again guys! I¹ll alert the dd-wrt team of the new dnsmasq update, too
On 3/26/10 2:53 PM, "Simon Kelley" <simon at thekelleys.org.uk> wrote:
> Don Muller wrote:
>> > Have you tried it without the double quotes?
>> > dhcp-option=66,22.214.171.124
> Without the quotes, dnsmasq will recognise a valid IP address and send
> it as a four-byte "binary" value, which isn't what's wanted here, it
> does need to be a string.
> This turns out to be a real bug, which is almost too bizarre to explain.
> A workaround is to move the quotes:
> Explanation: characters inside quotes get protected from acting as
> themselves by being temporarily mapped to ASCII control characters: that
> way the code which looks for dotted-quad IP addresses, etc and treats
> them specially is disabled.
> There's also some code which handles extra spaces around the commas,
> which used to use isspace() to look for characters to elide. That's
> fine for spaces (spaces inside quotes have been mapped to something
> else, so they don't get zapped) but is turns out that isspace() is also
> true for tabs and vertical tabs. the digit "7" gets mapped to a vertical
> tab, so it gets zapped by the "elide extra spaces" code. The fix is just
> to elide spaces, rather than anything which matches isspace().
> The workaround works because it stops the '7' character from being
> mapped to vertical tab, but the other characters are still protected, so
> dnsmasq doesn't treat the argument as dotted-quad.
> That bug has been there for _years_. Wow.
> Thanks to Dayton for spotting it.
> The fixed code is at:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Dnsmasq-discuss