ISC Open Source Projects issueshttps://gitlab.isc.org/groups/isc-projects/-/issues2019-03-12T22:11:43Zhttps://gitlab.isc.org/isc-projects/kea/-/issues/512remote-network4-del update2019-03-12T22:11:43ZFrancis Dupontremote-network4-del updateYou asked me what the code should do with the subnets when the shared network is being deleted. I updated the CB design doc: https://gitlab.isc.org/isc-projects/kea/wikis/designs/configuration-in-db-design#remote-network4-del
with two v...You asked me what the code should do with the subnets when the shared network is being deleted. I updated the CB design doc: https://gitlab.isc.org/isc-projects/kea/wikis/designs/configuration-in-db-design#remote-network4-del
with two variants that differ by "subnets-action" parameter. We need to add support for this parameter to explicitly control whether the subnets are kept or deleted. This idea is derived from the subnets_cmds hook and I believe that's the best option here too.
Note that the variant that removes a shared network but keeps subnets requires to update shared_network_name column for all these subnets to null. Perhaps the easiest way to do it via an SQL trigger.Kea1.6Francis DupontFrancis Duponthttps://gitlab.isc.org/isc-projects/kea/-/issues/511Return a list of all reservations by subnet ID - #313 for Cassandra back-end ...2019-05-22T16:59:20ZCathy AlmondReturn a list of all reservations by subnet ID - #313 for Cassandra back-end (if possible)This is a follow-on request from GL #313 - which was not implemented for Cassandra database back-end due to the technical challenges, described as:
In #313, the idea about paging is to reduce the communication:
- with SQL database you ...This is a follow-on request from GL #313 - which was not implemented for Cassandra database back-end due to the technical challenges, described as:
In #313, the idea about paging is to reduce the communication:
- with SQL database you can ask a page of the whole result from the DB: the kea-server will translate this page to JSON and sends to the requestor.
- with Cassandra you do not have this so you can get the whole result and page it in the kea-sever, etc.
To summarise, what matters is where the paging is done. In #313 we decided to do it only in the DB (so only for SQL DBs).
This ticket is to explore what we could to meet the use-case need (similarly or differently) with the Cassandra back-endKea1.6Razvan BecheriuRazvan Becheriuhttps://gitlab.isc.org/isc-projects/kea/-/issues/509Configuration knob to disable client-id lookup2019-05-10T11:22:24ZTomek MrugalskiConfiguration knob to disable client-id lookupWhile investigating a performance issue for a [customer issue](https://support.isc.org/Ticket/Display.html?id=14124), @tmark came up with an optimization idea to optionally disable client-id lookup.
Kea does two lease lookups: client-id...While investigating a performance issue for a [customer issue](https://support.isc.org/Ticket/Display.html?id=14124), @tmark came up with an optimization idea to optionally disable client-id lookup.
Kea does two lease lookups: client-id (if client sent client-id) and if a lease is not found, another one by MAC address. If admin doesn't care about client-id, the first one could be disabled.
This ticket's goal is to make this lookup optional. Obviously it should be enabled by default, but there should be a knob to disable it.
Instead of adding a new config knob, we should expand the meaning of existing match-client-id parameter.Kea1.6Francis DupontFrancis Duponthttps://gitlab.isc.org/isc-projects/kea/-/issues/508remote-network4-set doesn't save subnet2019-05-07T11:46:12ZWlodzimierz Wencelremote-network4-set doesn't save subnetWasn't it fixed in isc-projects/kea#493
Command:
```
{
"arguments": {
"remote": {
"type": "mysql"
},
"server-tags": [
"abc"
],
"shared-networks": [
{
"name": "net1",
"interface": "e...Wasn't it fixed in isc-projects/kea#493
Command:
```
{
"arguments": {
"remote": {
"type": "mysql"
},
"server-tags": [
"abc"
],
"shared-networks": [
{
"name": "net1",
"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": "net1"
}
]
},
"result": 0,
"text": "IPv4 shared network successfully set."
}
```
but mysql db is missing subnet:
```
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)
mysql> select * from dhcp4_subnet;
Empty set (0.00 sec)
```
and network4-get return incorrect network:
```
{
"arguments": {
"count": 1,
"shared-networks": [
{
"authoritative": false,
"interface": "enp0s9",
"match-client-id": true,
"name": "net1",
"option-data": [],
"relay": {
"ip-addresses": []
},
"reservation-mode": "all",
"subnet4": []
}
]
},
"result": 0,
"text": "IPv4 shared network 'net1' found."
}
```Kea1.6Francis DupontFrancis Duponthttps://gitlab.isc.org/isc-projects/kea/-/issues/503Refuse option definitions which duplicate a name/space2019-04-12T13:45:13ZFrancis DupontRefuse option definitions which duplicate a name/spaceToday it is allowed to define two options in the same space and with the same name because duplicates are checked only for code (already existing definition with the same code or conflicts with a standard option definition still with the...Today it is allowed to define two options in the same space and with the same name because duplicates are checked only for code (already existing definition with the same code or conflicts with a standard option definition still with the same code).Kea1.6Francis DupontFrancis Duponthttps://gitlab.isc.org/isc-projects/kea/-/issues/500remote-option-def4-set accepts incorrect code values2019-05-16T05:07:26ZWlodzimierz Wencelremote-option-def4-set accepts incorrect code valuesuser can configure option definition using code 0 or any code from standard options list.user can configure option definition using code 0 or any code from standard options list.Kea1.6Wlodzimierz WencelWlodzimierz Wencelhttps://gitlab.isc.org/isc-projects/kea/-/issues/499remote-global-parameter4-set command allows to configure kea with non existin...2019-03-07T15:52:55ZWlodzimierz Wencelremote-global-parameter4-set command allows to configure kea with non existing parameterscommand:
```
{
"arguments": {
"parameters": [
{
"name": "boot-fiabcsd",
"value": "/dev/null"
}
],
"remote": {
"type": "mysql"
},
"server-tags": [
"abc"
]
},
"command":...command:
```
{
"arguments": {
"parameters": [
{
"name": "boot-fiabcsd",
"value": "/dev/null"
}
],
"remote": {
"type": "mysql"
},
"server-tags": [
"abc"
]
},
"command": "remote-global-parameter4-set"
}
```
so I used non existing name. Result:
```
{
"result": 0,
"text": "DHCPv4 global parameter successfully set."
}
```
It wouldn't be bad but after kea reconfigure it accepts this as correct config and `config-get` returns:
```
{
"arguments": {
"Dhcp4": {
"boot-fiabcsd": "/dev/null",
"config-control": {
"config-databases": [
{
[...]
```Kea1.6Francis DupontFrancis Duponthttps://gitlab.isc.org/isc-projects/kea/-/issues/498pkg-config usage in kea libs is wrong2019-03-11T15:26:48ZOndřej Surýpkg-config usage in kea libs is wrong1. The file should be named `kea-dns++.pc` and not `dns++`
2. It references b10 libraries: `-lb10-dns++ -lb10-cryptolink -lb10-util -lb10-exceptions`
3. It references `-lm` which is probably not needed (I am guessing kea-dns++ doesn't ex...1. The file should be named `kea-dns++.pc` and not `dns++`
2. It references b10 libraries: `-lb10-dns++ -lb10-cryptolink -lb10-util -lb10-exceptions`
3. It references `-lm` which is probably not needed (I am guessing kea-dns++ doesn't export any of it's symbols)
It's also quite confusing that this is the only pkg-config file and it's only `dns++`. You should probably have accompanying .pc file (with correct intra-library dependencies declared) for every kea library.Kea1.6Francis DupontFrancis Duponthttps://gitlab.isc.org/isc-projects/kea/-/issues/494Dhcp4ConfigParser::sharedNetworksSanityChecks is buggy.2019-04-19T14:38:27ZFrancis DupontDhcp4ConfigParser::sharedNetworksSanityChecks is buggy.Reference https://gitlab.isc.org/isc-private/kea-premium/merge_requests/27 comment. BTW the v6 version could have the same problem.Reference https://gitlab.isc.org/isc-private/kea-premium/merge_requests/27 comment. BTW the v6 version could have the same problem.Kea1.6https://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/490DHCPv4 server must interpret unspecified subnet and shared network parameters...2019-03-29T15:07:32ZMarcin SiodelskiDHCPv4 server must interpret unspecified subnet and shared network parameters fetched from the DBThe DHCPv4 server fetches the subnets and shared networks from the database and merges them into the current configuration. For all subnet and network specific values that are marked "unspecified" it must use the higher level values, e.g...The DHCPv4 server fetches the subnets and shared networks from the database and merges them into the current configuration. For all subnet and network specific values that are marked "unspecified" it must use the higher level values, e.g. globals. This work depends on #487. For details see: https://gitlab.isc.org/isc-projects/kea/wikis/designs/configuration-in-db-design#encoding-other-unspecified-parametersKea1.6Marcin SiodelskiMarcin Siodelskihttps://gitlab.isc.org/isc-projects/kea/-/issues/489The MySQL Config Backend must store unspecified subnet and network parameters...2019-03-04T15:13:59ZMarcin SiodelskiThe MySQL Config Backend must store unspecified subnet and network parameters as nullThe subnet and shared network specific values that are not specified in the respective SET commands should be stored as null in the database. This work depends on #487. For more details consult: https://gitlab.isc.org/isc-projects/kea/wi...The subnet and shared network specific values that are not specified in the respective SET commands should be stored as null in the database. This work depends on #487. For more details consult: https://gitlab.isc.org/isc-projects/kea/wikis/designs/configuration-in-db-design#encoding-other-unspecified-parametersKea1.6Marcin SiodelskiMarcin Siodelskihttps://gitlab.isc.org/isc-projects/kea/-/issues/488Remove setting default values for the subnet and shared network in the cb_cmds2019-03-07T13:51:58ZMarcin SiodelskiRemove setting default values for the subnet and shared network in the cb_cmdsAs described in the config backend design: https://gitlab.isc.org/isc-projects/kea/wikis/designs/configuration-in-db-design#encoding-other-unspecified-parameters, the cb_cmds hooks library must not set default values for a subnet and sha...As described in the config backend design: https://gitlab.isc.org/isc-projects/kea/wikis/designs/configuration-in-db-design#encoding-other-unspecified-parameters, the cb_cmds hooks library must not set default values for a subnet and shared network and mark the missing values as "unspecified".Kea1.6Thomas MarkwalderThomas Markwalderhttps://gitlab.isc.org/isc-projects/kea/-/issues/487Modify subnet and shared network objects to hold information about unspecifie...2019-02-28T14:09:40ZMarcin SiodelskiModify subnet and shared network objects to hold information about unspecified valuesThe values of the Subnet and Network objects should be encapsulated in the `OptionalValue` template to be able to mark some of the parameters as unspecified if they are not set in the CB commands that set new subnet and shared network. S...The values of the Subnet and Network objects should be encapsulated in the `OptionalValue` template to be able to mark some of the parameters as unspecified if they are not set in the CB commands that set new subnet and shared network. See https://gitlab.isc.org/isc-projects/kea/wikis/designs/configuration-in-db-design#encoding-other-unspecified-parameters for the details.
Such change also requires that the subnet and shared network parsers are modified to mark values as unspecified if they are not explicitly set in the command.Kea1.6Marcin SiodelskiMarcin Siodelskihttps://gitlab.isc.org/isc-projects/kea/-/issues/486No longer use bison is yacc emulation mode.2019-03-11T12:55:19ZFrancis DupontNo longer use bison is yacc emulation mode.The autoconf AC_PROG_YACC used in configure sets the YACC variable to "bison -y" but:
- we do not use any feature of the yacc emulation mode, in particular for output file names.
- we use a lot of bison specific features: this gives a ...The autoconf AC_PROG_YACC used in configure sets the YACC variable to "bison -y" but:
- we do not use any feature of the yacc emulation mode, in particular for output file names.
- we use a lot of bison specific features: this gives a lot of warnings with recent bison versions.
Note an alternative is to disable yacc mode warnings (-Wno-yacc) but even it requires more testing avoid the yacc mode is a far cleaner solution.Kea1.6Tomek MrugalskiTomek Mrugalskihttps://gitlab.isc.org/isc-projects/kea/-/issues/485Stricter check for flex in configure.2019-03-11T13:10:02ZFrancis DupontStricter check for flex in configure.I propose to change
```
if test "x$LEX" == "x"; then
```
into
```
if test "x$LEX" != "xflex"; then
```
in the unlikely but possible case where lex but but not flex is available as recommended in AC_PROG_LEX documentation.I propose to change
```
if test "x$LEX" == "x"; then
```
into
```
if test "x$LEX" != "xflex"; then
```
in the unlikely but possible case where lex but but not flex is available as recommended in AC_PROG_LEX documentation.Kea1.6Francis DupontFrancis Duponthttps://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/480Fix shellcheck issues in Kea scripts2019-03-15T23:23:29ZTomek MrugalskiFix shellcheck issues in Kea scripts@ondrej pointed out that shellcheck, a tool that sanitizes shell scripts, reported issues in keactrl.
This task is about addressing those issues in keactrl and checking other user-visible scripts.
The tool is available as on-line servi...@ondrej pointed out that shellcheck, a tool that sanitizes shell scripts, reported issues in keactrl.
This task is about addressing those issues in keactrl and checking other user-visible scripts.
The tool is available as on-line service (https://www.shellcheck.net/), but also as command line tool.
Moved this directly to 1.6, because it's coming from Debian package maintainer, so it's related to an objective of 1.6.Kea1.6Tomek MrugalskiTomek Mrugalskihttps://gitlab.isc.org/isc-projects/kea/-/issues/478Improve error message: "Database access parameter 'type' does not specify a s...2019-03-06T20:25:35ZCathy AlmondImprove error message: "Database access parameter 'type' does not specify a supported database backend:mysql"---
name: Improve error message: "Database access parameter 'type' does not specify a supported database backend:mysql"
about: Please make it clearer why this error is being emitted. The 'type' is a valid configuration option. The prob...---
name: Improve error message: "Database access parameter 'type' does not specify a supported database backend:mysql"
about: Please make it clearer why this error is being emitted. The 'type' is a valid configuration option. The problem is that the build does not include support for mysql back-end.
---
These error messages don't explain well what the problem is and where to look to fix it:
> root@debian:/opt/kea-1.5.0# 2019-02-18 17:26:12.746 ERROR [kea-dhcp4.dhcp4/51240] DHCP4_CONFIG_LOAD_FAIL configuration error using file: /usr/local/etc/kea/kea-dhcp4.conf, reason: Unable to open database: Database access parameter 'type' does not specify a supported database backend:mysql
> 2019-02-18 17:26:12.746 ERROR [kea-dhcp4.dhcp4/51240] DHCP4_INIT_FAIL failed to initialize Kea server: configuration error using file '/usr/local/etc/kea/kea-dhcp4.conf': Unable to open database: Database access parameter 'type' does not specify a supported database backend:mysql
A better message would be something like:
"Unable to open database: The Kea server has not been built with support for database type: mysql"
See [#14213](https://support.isc.org/Ticket/Display.html?id=14213)Kea1.6Francis DupontFrancis Dupont