flexible option hook is creating string options differently than kea core
Test case is very simple, configuration as follows:
{
"Dhcp6": {
"hooks-libraries": [
{
"library": "/home/wlodek/installed/git-thread/lib/kea/hooks/libdhcp_flex_option.so",
"parameters": {
"options": [
{
"code": 41,
"supersede": "ifelse(relay6[0].peeraddr == 3000::1005, 'EST5EDT4\\,M3.2.0/02:00\\,M11.1.0/02:00','')"
}
]
}
}
],
"interfaces-config": {
"interfaces": [
"enp0s9"
]
},
"lease-database": {
"type": "memfile"
},
"loggers": [
{
"debuglevel": 99,
"name": "kea-dhcp6",
"output_options": [
{
"output": "/home/wlodek/installed/git-thread/var/log/kea.log"
}
],
"severity": "DEBUG"
}
],
"multi-threading": {
"enable-multi-threading": true,
"packet-queue-size": 16,
"thread-pool-size": 2
},
"option-data": [
{
"code": 41,
"csv-format": true,
"data": "EST5EDT4\\,M3.2.0/02:00\\,M11.1.0/02:00",
"name": "new-posix-timezone",
"space": "dhcp6"
}
],
"preferred-lifetime": 3000,
"rebind-timer": 2000,
"renew-timer": 1000,
"shared-networks": [],
"subnet6": [
{
"interface": "enp0s9",
"pools": [
{
"pool": "2001:db8:1::1-2001:db8:1::1"
}
],
"subnet": "2001:db8:1::/64"
}
],
"valid-lifetime": 4000
}
}
We have configured option "new-posix-timezone" at global level and in flexible option, with the same value!
And I'm sending two advertise (inside Relay Forward), one message has peeraddr == 3000::1005 other don't. Kea is configured in a way that those two reply messages should be identical, but string in option that is created by hook has not escaped commas. Which is inconsistent behaviour with kea core. I'm adding capture from this test.