[Dnsmasq-discuss] dhcp-option and quotes
Simon Kelley
simon at thekelleys.org.uk
Sat Feb 23 17:55:50 GMT 2013
On 22/02/13 20:26, Laine Stump wrote:
> On 02/22/2013 02:23 PM, Laine Stump wrote:
>> 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?
>
> In response to myself after experimenting - the former sends a single
> newline character, the latter literally sends the two characters '\' and
> 'n'. Bah.
>
> So I suppose it's reasonable to add quotes any time there is an escape
> ("\") character. Any other metacharacter that would require quotes?
>
>>
>> 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"
>>
>> ?
>>
The set of characters which behave as themselves inside quotes, but may
mean something else outside of quotes is:
0-9 a-f A_F :,.
and \ has special meaning, as you have discovered, inside quotes.
>> 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)?
No, you can only use the option6: options for DHCPv6. The IETF didn't
carry over the existing option definitions from DHCPv4 to DHCPv6
Cheers,
Simon.
>>
>> _______________________________________________
>> Dnsmasq-discuss mailing list
>> Dnsmasq-discuss at lists.thekelleys.org.uk
>> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>>
>
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>
More information about the Dnsmasq-discuss
mailing list