[Dnsmasq-discuss] dhcp-option and quotes

Laine Stump laine at laine.org
Fri Feb 22 19:23:59 GMT 2013


In most examples of dhcp-option, I see that the option value isn't
quoted. The exceptions seem to be:

1) when there is a space in the option value, it is quoted to preserve
the space
2) For option 252 to include an "empty" option,
http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq.conf.example does this:

    dhcp-option=252,"\n"

So now I'm wondering if the quotes in the above situation are necessary,
or if they're superfluous. Would this:

    dhcp-option=252,\n

end up sending the same packet, or something different?

Also, what happens wrt quotes when there are multiple, comma separated
values, eg:

  dhcp-option=121,192.168.1.0/24,1.2.3.4,10.0.0.0/8,5.6.7.8

Could that be safely quoted as:

  dhcp-option=121,"192.168.1.0/24,1.2.3.4,10.0.0.0/8,5.6.7.8"

?

I guess the basic question is "what, aside from spaces, must be quoted
in a dhcp option value?"

(I'm asking this because we're adding support for dhcp options to
libvirt's networks, and the person who submitted the patch had it always
quoting the values.)

Another question I have: which options are legal for DHCP6, and are they
only used for DHCP6 if they are listed as

    dhcp-option=option6:....

or are the plain dhcp-options also used for DHCP6 (when they don't
involve IP addresses anyway)?



More information about the Dnsmasq-discuss mailing list