remote-network4-set accept empty name
{
"arguments": {
"remote": {
"type": "mysql"
},
"server-tags": [
"abc"
],
"shared-networks": [
{
"name": "",
"interface": "enp0s9",
"subnet4": [
{
"interface": "enp0s9",
"pools": [
{
"pool": "192.168.52.1-192.168.52.100"
}
],
"subnet": "192.168.52.0/24"
}
]
}
]
},
"command": "remote-network4-set"
}
result:
{
"arguments": {
"shared-networks": [
{
"name": ""
}
]
},
"result": 0,
"text": "IPv4 shared network successfully set."
}
mysql> select * from dhcp4_shared_network;
+----+------+--------------+-----------+-----------------+---------------------+--------------+-------+-------------+------------------------+------------------+--------------+----------------+
| id | name | client_class | interface | match_client_id | modification_ts | rebind_timer | relay | renew_timer | require_client_classes | reservation_mode | user_context | valid_lifetime |
+----+------+--------------+-----------+-----------------+---------------------+--------------+-------+-------------+------------------------+------------------+--------------+----------------+
| 1 | | NULL | enp0s9 | 1 | 2019-02-21 05:40:02 | NULL | NULL | NULL | [ ] | 3 | NULL | NULL |
+----+------+--------------+-----------+-----------------+---------------------+--------------+-------+-------------+------------------------+------------------+--------------+----------------+
1 row in set (0.00 sec)
interesting fact is that after kea restart (to force merging config) kea logs:
[kea-dhcp4.dhcp4/20684] DHCP4_OPEN_CONFIG_DB Opening configuration database: name=keadb password=***** type=mysql user=keauser
[kea-dhcp4.dhcp4/20684] DHCP4_CONFIG_FETCH Fetching configuration data from config backends.
[kea-dhcp4.dhcp4/20684] DHCP4_CONFIG_MERGED Configuration backend data has been merged.
So it looks like it was accepted, so I checked running configuration using config-get
and this is what I found:
"shared-networks": [
{
"authoritative": false,
"interface": "enp0s9",
"match-client-id": true,
"option-data": [],
"relay": {
"ip-addresses": []
},
"reservation-mode": "all",
"subnet4": []
}
],
so:
- kea accepted empty name
- remote-network4-set command doesn't save subnet in the database (probably another issue should be opened for this)
Also I re-run test for shared-network empty name in JSON configuration file and there kea complain about empty name parameter and fail to start.