remote-option-def4-get-all return incorrect tag when option definition is configured with "all"
- kea is configured with:
"Dhcp4": {
"config-control": {
"config-databases": [
{
"name": "keadb",
"password": "keapass",
"type": "mysql",
"user": "keauser"
}
]
},
"control-socket": {
"socket-name": "/home/wlodek/installed/git/var/run/kea/control_socket",
"socket-type": "unix"
},
"hooks-libraries": [
{
"library": "/home/wlodek/installed/git/lib/kea/hooks/libdhcp_cb_cmds.so"
},
{
"library": "/home/wlodek/installed/git/lib/kea/hooks/libdhcp_mysql_cb.so"
}
],
"interfaces-config": {
"interfaces": [
"enp0s9"
]
},
"lease-database": {
"type": "memfile"
},
"loggers": [
{
"debuglevel": 99,
"name": "kea-dhcp4",
"output_options": [
{
"output": "/home/wlodek/installed/git/var/log/kea.log"
}
],
"severity": "DEBUG"
}
],
"server-tag": "abc"
}
completely basic.
-
added server-tag "abc" to database.
-
then I'm sending command to set option definition:
{'arguments': {'option-defs': [{'code': 222,
'name': 'foo',
'type': 'uint32'}],
'remote': {'type': 'mysql'},
'server-tags': ['all']},
'command': 'remote-option-def4-set',
'service': ['dhcp4']}
response is correct:
{
"arguments": {
"option-defs": [
{
"code": 222,
"space": "dhcp4"
}
]
},
"result": 0,
"text": "DHCPv4 option definition successfully set."
}
than I'm checking database content:
mysql> select * from dhcp4_option_def;
+----+------+------+-------+------+---------------------+-------+-------------+--------------+--------------+
| id | code | name | space | type | modification_ts | array | encapsulate | record_types | user_context |
+----+------+------+-------+------+---------------------+-------+-------------+--------------+--------------+
| 1 | 222 | foo | dhcp4 | 8 | 2019-07-16 09:46:13 | 0 | | NULL | NULL |
+----+------+------+-------+------+---------------------+-------+-------------+--------------+--------------+
1 row in set (0.01 sec)
mysql> select * from dhcp4_option_def_server;
+---------------+-----------+---------------------+
| option_def_id | server_id | modification_ts |
+---------------+-----------+---------------------+
| 1 | 1 | 2019-07-16 09:46:13 |
+---------------+-----------+---------------------+
1 row in set (0.00 sec)
mysql> select * from dhcp4_server;
+-----+-----+---------------------------+---------------------+
| id | tag | description | modification_ts |
+-----+-----+---------------------------+---------------------+
| 1 | all | special type: all servers | 2019-06-06 07:06:58 |
| 173 | abc | | 2019-07-16 09:46:13 |
+-----+-----+---------------------------+---------------------+
2 rows in set (0.01 sec)
all checks out, our new option definition is assigned to tag "all"
- execute command remote-option-def4-get-all
{'arguments': {'remote': {'type': 'mysql'}, 'server-tags': ['abc']},
'command': 'remote-option-def4-get-all',
'service': ['dhcp4']}
and configured option is returned with incorrect tag:
{
"arguments": {
"count": 1,
"option-defs": [
{
"array": false,
"code": 222,
"encapsulate": "",
"metadata": {
"server-tags": [
"abc" <<<<<<<<<<<<<<<<<<<< should be "all"
]
},
"name": "foo",
"record-types": "",
"space": "dhcp4",
"type": "uint32"
}
]
},
"result": 0,
"text": "1 DHCPv4 option definition(s) found."
}
Edited by Wlodzimierz Wencel