Kea issueshttps://gitlab.isc.org/isc-projects/kea/-/issues2019-04-16T09:58:51Zhttps://gitlab.isc.org/isc-projects/kea/-/issues/517remote-network4-set doesn't save some parameters2019-04-16T09:58:51ZWlodzimierz Wencelremote-network4-set doesn't save some parametersconfig parameters:
* rebind-timer
* renew-timer
* valid-lifetime
* reservation-mode
are not saved when remote-network4-set is used.
**Scenario**
add network:
```
{
"arguments": {
"remote": {
"type": "mysql"
},
"serv...config parameters:
* rebind-timer
* renew-timer
* valid-lifetime
* reservation-mode
are not saved when remote-network4-set is used.
**Scenario**
add network:
```
{
"arguments": {
"remote": {
"type": "mysql"
},
"server-tags": [
"abc"
],
"shared-networks": [
{
"client-class": "abc",
"interface": "enp0s9",
"name": "net1",
"option-data": [
{
"always-send": true,
"code": 6,
"csv-format": true,
"data": "192.0.2.1"
}
],
"rebind-timer": 200,
"renew-timer": 100,
"reservation-mode": "global",
"subnet4": [
{
"interface": "enp0s9",
"pools": [
{
"pool": "192.8.0.1-192.8.0.1"
}
],
"subnet": "192.8.0.0/24"
}
],
"user-context": "some weird network",
"valid-lifetime": 300
}
]
},
"command": "remote-network4-set"
}
```
response:
```
{
"arguments": {
"shared-networks": [
{
"name": "net1"
}
]
},
"result": 0,
"text": "IPv4 shared network successfully set."
}
```
get network:
```
{
"arguments": {
"remote": {
"type": "mysql"
},
"server-tags": [
"abc"
],
"shared-networks": [
{
"name": "net1"
}
]
},
"command": "remote-network4-get"
}
```
returned configuration:
```
{
"arguments": {
"count": 1,
"shared-networks": [
{
"authoritative": false,
"client-class": "abc",
"interface": "enp0s9",
"match-client-id": true,
"name": "net1",
"option-data": [
{
"always-send": true,
"code": 6,
"csv-format": true,
"data": "192.0.2.1",
"name": "domain-name-servers",
"space": "dhcp4"
}
],
"relay": {
"ip-addresses": []
},
"reservation-mode": "all",
"subnet4": [],
"user-context": "some weird network"
}
]
},
"result": 0,
"text": "IPv4 shared network 'net1' found."
}
```
quick peak into database:
```
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 | net1 | abc | enp0s9 | 1 | 2019-03-01 05:31:28 | NULL | NULL | NULL | [ ] | 3 | "some weird network" | NULL |
+----+------+--------------+-----------+-----------------+---------------------+--------------+-------+-------------+------------------------+------------------+----------------------+----------------+
1 row in set (0.00 sec)
```
...and values are indeed missing. Related: isc-projects/kea#508Kea1.6Marcin SiodelskiMarcin Siodelskihttps://gitlab.isc.org/isc-projects/kea/-/issues/493remote-network4-set accept empty name2019-02-27T15:46:03ZWlodzimierz Wencelremote-network4-set accept empty name```
{
"arguments": {
"remote": {
"type": "mysql"
},
"server-tags": [
"abc"
],
"shared-networks": [
{
"name": "",
"interface": "enp0s9",
"subnet4": [
{
...```
{
"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:
1. kea accepted empty name
1. 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.Kea1.6https://gitlab.isc.org/isc-projects/kea/-/issues/492CB subnet merge vs duplicate subnet prefixes2019-05-24T17:04:21ZFrancis DupontCB subnet merge vs duplicate subnet prefixesCurrent CfgSubnets4::merge method checks duplicate subnet IDs (erase the existing one before push back the new one) but not duplicate prefixes (subnet fields). I guess that the push back will throw, at least it fails as the prefix is an ...Current CfgSubnets4::merge method checks duplicate subnet IDs (erase the existing one before push back the new one) but not duplicate prefixes (subnet fields). I guess that the push back will throw, at least it fails as the prefix is an unique index in the multi index container.
It is a corner case because it is unlikely to get two subnets with exactly (ref #36) the same prefix but different IDs. But it is still possible and the correct action when it happens needs to be defined.
#481 is related but not a duplicate.Kea1.6Marcin SiodelskiMarcin Siodelskihttps://gitlab.isc.org/isc-projects/kea/-/issues/481remote-subnet4-set inconsistent work when id/subnet is duplicated.2019-03-20T09:04:02ZWlodzimierz Wencelremote-subnet4-set inconsistent work when id/subnet is duplicated.1. Kea is started without any subnet configured.
1. execute command `remote-subnet4-set`:
```
{"command": "remote-subnet4-set",
"arguments": {"subnets": [{"interface": "enp0s9",
"subnet": "192.168...1. Kea is started without any subnet configured.
1. execute command `remote-subnet4-set`:
```
{"command": "remote-subnet4-set",
"arguments": {"subnets": [{"interface": "enp0s9",
"subnet": "192.168.50.0/24",
"pools": [{"pool": "192.168.50.1-192.168.50.100"}],
"id": 5}],
"server-tags": ["abc"],
"remote": {"type": "mysql"}
}
}
```
3. Kea will be configured correctly with subnet 192.168.50.0/24 with id 5.
4. Let's now execute command `remote-subnet4-set` with different subnet but with the same value of id:
```
{"command": "remote-subnet4-set",
"arguments": {"subnets": [{"interface": "enp0s9",
"subnet": "192.168.51.0/24",
"pools": [{"pool": "192.168.51.1-192.168.51.100"}],
"id": 5}],
"server-tags": ["abc"],
"remote": {"type": "mysql"}
}
}
```
```
{
"arguments": {
"subnets": [
{
"id": 5,
"subnet": "192.168.51.0/24"
}
]
},
"result": 0,
"text": "IPv4 subnet successfully set."
}
```
```
mysql> select * from dhcp4_subnet;
+-----------+-----------------+---------------+------------------+------------+----------------+--------------+-----------+-----------------+---------------------+-------------+--------------+-------+-------------+------------------------+------------------+-----------------+---------------------+--------------+----------------+
| subnet_id | subnet_prefix | 4o6_interface | 4o6_interface_id | 4o6_subnet | boot_file_name | client_class | interface | match_client_id | modification_ts | next_server | rebind_timer | relay | renew_timer | require_client_classes | reservation_mode | server_hostname | shared_network_name | user_context | valid_lifetime |
+-----------+-----------------+---------------+------------------+------------+----------------+--------------+-----------+-----------------+---------------------+-------------+--------------+-------+-------------+------------------------+------------------+-----------------+---------------------+--------------+----------------+
| 5 | 192.168.51.0/24 | NULL | NULL | NULL | NULL | NULL | enp0s9 | 1 | 2019-02-19 06:05:39 | NULL | NULL | NULL | NULL | [ ] | 3 | NULL | NULL | NULL | 7200 |
+-----------+-----------------+---------------+------------------+------------+----------------+--------------+-----------+-----------------+---------------------+-------------+--------------+-------+-------------+------------------------+------------------+-----------------+---------------------+--------------+----------------+
```
result: there is now just one subnet configured and it's `192.168.51.0/24` so previous one was overwritten without warning/notification
5. But when second command will duplicated subnet kea will respond with a bit cryptic error:
```
{
"result": 1,
"text": "unable to execute for <INSERT INTO dhcp4_pool( start_address, end_address, subnet_id, modification_ts) VALUES (?, ?, ?, ?)>, reason: Cannot add or update a child row: a foreign key constraint fails (`keadb`.`dhcp4_pool`, CONSTRAINT `fk_dhcp4_pool_subnet_id` FOREIGN KEY (`subnet_id`) REFERENCES `dhcp4_subnet` (`subnet_id`) ON DELETE CASCADE ON UPDATE CASCADE) (error code 1452)"
}
```
`id` and `subnet` are two ways of exactly identify record in database so I guess it should work in the same manner. Either override, or return error saying that there is such record in the database.Kea1.6https://gitlab.isc.org/isc-projects/kea/-/issues/456failing cb_cmd unit tests2019-03-06T12:09:57ZWlodzimierz Wencelfailing cb_cmd unit testsWe have one tests that is failing on 3 different systems:
https://jenkins.isc.org/job/kea-master/247/testReport/
which git commits were tested: https://jenkins.isc.org/job/kea-master/247/We have one tests that is failing on 3 different systems:
https://jenkins.isc.org/job/kea-master/247/testReport/
which git commits were tested: https://jenkins.isc.org/job/kea-master/247/Kea1.6Wlodzimierz WencelWlodzimierz Wencelhttps://gitlab.isc.org/isc-projects/kea/-/issues/409Update cb_cmds with commands to manage other objects for DHCPv62019-05-15T15:01:03ZMarcin SiodelskiUpdate cb_cmds with commands to manage other objects for DHCPv6CB DHCPv6 code for shared networks, option definitions and option datas.
CB DHCPv6 code for shared networks, option definitions and option datas.
Kea1.6Francis DupontFrancis Duponthttps://gitlab.isc.org/isc-projects/kea/-/issues/408Update cb_cmds with commands to manage subnets for DHCPv62019-05-11T08:00:36ZMarcin SiodelskiUpdate cb_cmds with commands to manage subnets for DHCPv6Managing subnets in CB DHCPv6. Will be reuse as a skeleton for other DHCPv6 objects (shared network, option definition and data) in #409.
Managing subnets in CB DHCPv6. Will be reuse as a skeleton for other DHCPv6 objects (shared network, option definition and data) in #409.
Kea1.6Francis DupontFrancis Duponthttps://gitlab.isc.org/isc-projects/kea/-/issues/407Update cb_cmds with commands to manage global parameters for DHCPv62019-05-09T13:00:46ZMarcin SiodelskiUpdate cb_cmds with commands to manage global parameters for DHCPv6First part of CB DHCPv6 work: it will be divided into a premium MR reorganizing code and a second MR adding the DHCPv6 part for global parameters.
First part of CB DHCPv6 work: it will be divided into a premium MR reorganizing code and a second MR adding the DHCPv6 part for global parameters.
Kea1.6Francis DupontFrancis Duponthttps://gitlab.isc.org/isc-projects/kea/-/issues/406Update cb_cmds with commands to retrieve configuration data for DHCPv42019-11-26T10:34:09ZMarcin SiodelskiUpdate cb_cmds with commands to retrieve configuration data for DHCPv4We need to update the cb_cmds hooks library to support commands to retrieve configuration information from the database via the configuration backend for subnets, shared networks, global parameters, options and option definitions. The fo...We need to update the cb_cmds hooks library to support commands to retrieve configuration information from the database via the configuration backend for subnets, shared networks, global parameters, options and option definitions. The following are the examples of the corresponding backend commands: `getSubnet4`, `getModifiedSubnets4` etc.Kea1.6Francis DupontFrancis Duponthttps://gitlab.isc.org/isc-projects/kea/-/issues/405Update cb_cmds with commands to delete configuration data for DHCPv42019-01-25T22:47:56ZMarcin SiodelskiUpdate cb_cmds with commands to delete configuration data for DHCPv4The cb_cmds must be updated to support commands to delete subnets, shared networks, options, option definitions and global parameters from the database via the configuration backends, e.g. `deleteSubnet4`, `deleteAllSubnets4` etc.The cb_cmds must be updated to support commands to delete subnets, shared networks, options, option definitions and global parameters from the database via the configuration backends, e.g. `deleteSubnet4`, `deleteAllSubnets4` etc.Kea1.6Francis DupontFrancis Duponthttps://gitlab.isc.org/isc-projects/kea/-/issues/394Recalculate statistics when server configuration is changed as a result of a ...2019-04-10T08:55:27ZMarcin SiodelskiRecalculate statistics when server configuration is changed as a result of a commandWhile reviewing !197 we found a general issue that statistics needs to be recalculated when incremental changes are applied to the configuration. The specific case discussed in !197 was that when new subnet is added to the database and t...While reviewing !197 we found a general issue that statistics needs to be recalculated when incremental changes are applied to the configuration. The specific case discussed in !197 was that when new subnet is added to the database and the server detects this change, it will fetch the subnet data and merge the subnet into the configuration it is currently running. Because, it bypasses the staging/commit phase, the statistics is not recalculated.
We also checked that subnet_cmds doesn't deal with this problem either. We may need to find some generic solution for it.Kea1.6https://gitlab.isc.org/isc-projects/kea/-/issues/292Possible issue at exit with dynamic host backend2019-01-11T16:33:20ZFrancis DupontPossible issue at exit with dynamic host backendCf #87: there were some problems (supposedly fixed) with dynamic host backend destruction at server exit. They could need more work (invalid write reported by valgrind) and they definitively require a more robust solution. BTW they are v...Cf #87: there were some problems (supposedly fixed) with dynamic host backend destruction at server exit. They could need more work (invalid write reported by valgrind) and they definitively require a more robust solution. BTW they are variants of the global destructor disaster so very system dependent.Kea1.6Francis DupontFrancis Dupont