[Kea-users] commas in value
Carsten Strotmann
carsten at strotmann.de
Mon Jul 7 07:39:57 UTC 2025
Hi Christoph,
On 7 Jul 2025, at 9:21, Christoph Pleger wrote:
> Hello,
>
> In my kea DHCP4 configuration, I have this line:
>
> "data": "dc=cs,dc=tu-dortmund,dc=de"
>
> As I discovered on the client side, the commas are interpreted as strong separators, so that when I print that data on client side, only dc=cs is printed. What syntax do I have to use in the config so that the whole above string is interpreted as one value?
>
from:
https://kea.readthedocs.io/en/kea-3.0.0/arm/dhcp4-srv.html#standard-dhcpv4-options
When a data field is a string and that string contains the comma (,; U+002C) character, the comma must be escaped with two backslashes (\\,; U+005C). This double escape is required because both the routine splitting of CSV data into fields and JSON use the same escape character; a single escape (\,) would make the JSON invalid. For example, the string "foo,bar" must be represented as:
"Dhcp4": {
"subnet4": [
{
"pools": [
{
"option-data": [
{
"name": "boot-file-name",
"data": "foo\\,bar"
}
]
},
...
],
...
},
...
],
...
}
Greetings
Carsten
More information about the Kea-users
mailing list