Dynamicaly generated vendor-encapsulated-options-space "data" field saved with config-write
name: Bug report
about: Create a report to help us improve
Describe the bug
Kea DHCP4 generates a hex string (stored in the "data" field) for nested options data. This is saved to the configuration file on a config-write API call. Subsequent configuration loads read this field but do not update it, even if the nested options change or are removed.
To Reproduce
Steps to reproduce the behavior:
- Run Kea dhcpv4, with a custom option definition:
"option-def": [
{
"array": true,
"code": 241,
"encapsulate": "",
"name": "wlc-list",
"record-types": "",
"space": "vendor-encapsulated-options-space",
"type": "ipv4-address"
}
- Add the custom option with data (global or subnet scoped).
"option-data": [
{
"name": "vendor-encapsulated-options"
},
{
"always-send": false,
"code": 241,
"csv-format": true,
"data": "1.1.1.1",
"name": "wlc-list",
"space": "vendor-encapsulated-options-space"
}
]
-
Use the
config-reload
and then theconfig-write
API calls -
Note that the vendor-encapsulated-options
data
field is populated from the sub-option data.
{
"always-send": false,
"code": 43,
"csv-format": false,
"data": "F10401010101",
"name": "vendor-encapsulated-options",
"space": "dhcp4"
},
{
"always-send": false,
"code": 241,
"csv-format": true,
"data": "1.1.1.1",
"name": "wlc-list",
"space": "vendor-encapsulated-options-space"
}
- Change the 241 sub-option data but leave the option 43 data.
{
"always-send": false,
"code": 241,
"csv-format": true,
"data": "2.2.2.2",
"name": "wlc-list",
"space": "vendor-encapsulated-options-space"
}
- Use the
config-reload
and then theconfig-write
API calls - Note vendor-encapsulated-options data field has not been updated and hence, the changes will not be reflected in offers to clients.
{
"always-send": false,
"code": 43,
"csv-format": false,
"data": "F10401010101",
"name": "vendor-encapsulated-options",
"space": "dhcp4"
},
{
"always-send": false,
"code": 241,
"csv-format": true,
"data": "2.2.2.2",
"name": "wlc-list",
"space": "vendor-encapsulated-options-space"
}
Expected behavior
I'd expect a field dynamically generated from dependent configuration wouldn't be written to the configuration file, or at least would be updated when the dependent configuration changes.
Environment:
- Kea version: 1.8.2
- OS: Alpine Linux
1.8.2 tarball linked with: log4cplus 2.0.6 Botan 2.17.3 (release, dated 20201221, revision git:bcda19704da482c57eb0bce786cebb97f378f146, distribution unspecified) database: MySQL backend 9.3, library 10.5.5 PostgreSQL backend 6.1, library 130003 Memfile backend 2.1