Kea issueshttps://gitlab.isc.org/isc-projects/kea/-/issues2024-03-27T13:50:40Zhttps://gitlab.isc.org/isc-projects/kea/-/issues/3225when applying MT settings from CB the libs compatibility is not rechecked2024-03-27T13:50:40ZRazvan Becheriuwhen applying MT settings from CB the libs compatibility is not recheckedMT disabled -\> check libs (success) -\> load libs -\> CB load config -\> MT enabled -\> no checking of libs -\> could end up with non MT compatible libs loaded and used in MTMT disabled -\> check libs (success) -\> load libs -\> CB load config -\> MT enabled -\> no checking of libs -\> could end up with non MT compatible libs loaded and used in MTnext-stable-3.0https://gitlab.isc.org/isc-projects/kea/-/issues/3224CB commands should use processDhcp[4|6]Config to validate content of global p...2024-02-01T14:46:08ZRazvan BecheriuCB commands should use processDhcp[4|6]Config to validate content of global parameterssetting global parameters using CB commands does not check if values are valid. They are merged into the current config with no check. this could have an undesired effect on the running server.
global scalar parameters v4:
```plaintext...setting global parameters using CB commands does not check if values are valid. They are merged into the current config with no check. this could have an undesired effect on the running server.
global scalar parameters v4:
```plaintext
if ( (config_pair.first == "renew-timer") ||
(config_pair.first == "rebind-timer") ||
(config_pair.first == "valid-lifetime") ||
(config_pair.first == "min-valid-lifetime") ||
(config_pair.first == "max-valid-lifetime") ||
(config_pair.first == "decline-probation-period") ||
(config_pair.first == "dhcp4o6-port") ||
(config_pair.first == "echo-client-id") ||
(config_pair.first == "match-client-id") ||
(config_pair.first == "authoritative") ||
(config_pair.first == "next-server") ||
(config_pair.first == "server-hostname") ||
(config_pair.first == "boot-file-name") ||
(config_pair.first == "server-tag") ||
(config_pair.first == "reservation-mode") ||
(config_pair.first == "reservations-global") ||
(config_pair.first == "reservations-in-subnet") ||
(config_pair.first == "reservations-out-of-pool") ||
(config_pair.first == "calculate-tee-times") ||
(config_pair.first == "t1-percent") ||
(config_pair.first == "t2-percent") ||
(config_pair.first == "cache-threshold") ||
(config_pair.first == "cache-max-age") ||
(config_pair.first == "hostname-char-set") ||
(config_pair.first == "hostname-char-replacement") ||
(config_pair.first == "ddns-send-updates") ||
(config_pair.first == "ddns-override-no-update") ||
(config_pair.first == "ddns-override-client-update") ||
(config_pair.first == "ddns-replace-client-name") ||
(config_pair.first == "ddns-generated-prefix") ||
(config_pair.first == "ddns-qualifying-suffix") ||
(config_pair.first == "ddns-update-on-renew") ||
(config_pair.first == "ddns-use-conflict-resolution") ||
(config_pair.first == "ddns-conflict-resolution-mode") ||
(config_pair.first == "ddns-ttl-percent") ||
(config_pair.first == "store-extended-info") ||
(config_pair.first == "statistic-default-sample-count") ||
(config_pair.first == "statistic-default-sample-age") ||
(config_pair.first == "early-global-reservations-lookup") ||
(config_pair.first == "ip-reservations-unique") ||
(config_pair.first == "reservations-lookup-first") ||
(config_pair.first == "parked-packet-limit") ||
(config_pair.first == "allocator") ||
(config_pair.first == "offer-lifetime") ) {
CfgMgr::instance().getStagingCfg()->addConfiguredGlobal(config_pair.first,
config_pair.second);
continue;
}
```
global scalar parameters v6:
```plaintext
if ( (config_pair.first == "renew-timer") ||
(config_pair.first == "rebind-timer") ||
(config_pair.first == "preferred-lifetime") ||
(config_pair.first == "min-preferred-lifetime") ||
(config_pair.first == "max-preferred-lifetime") ||
(config_pair.first == "valid-lifetime") ||
(config_pair.first == "min-valid-lifetime") ||
(config_pair.first == "max-valid-lifetime") ||
(config_pair.first == "decline-probation-period") ||
(config_pair.first == "dhcp4o6-port") ||
(config_pair.first == "server-tag") ||
(config_pair.first == "reservation-mode") ||
(config_pair.first == "reservations-global") ||
(config_pair.first == "reservations-in-subnet") ||
(config_pair.first == "reservations-out-of-pool") ||
(config_pair.first == "calculate-tee-times") ||
(config_pair.first == "t1-percent") ||
(config_pair.first == "t2-percent") ||
(config_pair.first == "cache-threshold") ||
(config_pair.first == "cache-max-age") ||
(config_pair.first == "hostname-char-set") ||
(config_pair.first == "hostname-char-replacement") ||
(config_pair.first == "ddns-send-updates") ||
(config_pair.first == "ddns-override-no-update") ||
(config_pair.first == "ddns-override-client-update") ||
(config_pair.first == "ddns-replace-client-name") ||
(config_pair.first == "ddns-generated-prefix") ||
(config_pair.first == "ddns-qualifying-suffix") ||
(config_pair.first == "ddns-update-on-renew") ||
(config_pair.first == "ddns-use-conflict-resolution") ||
(config_pair.first == "ddns-conflict-resolution-mode") ||
(config_pair.first == "ddns-ttl-percent") ||
(config_pair.first == "store-extended-info") ||
(config_pair.first == "statistic-default-sample-count") ||
(config_pair.first == "statistic-default-sample-age") ||
(config_pair.first == "early-global-reservations-lookup") ||
(config_pair.first == "ip-reservations-unique") ||
(config_pair.first == "reservations-lookup-first") ||
(config_pair.first == "parked-packet-limit") ||
(config_pair.first == "allocator") ||
(config_pair.first == "pd-allocator") ) {
CfgMgr::instance().getStagingCfg()->addConfiguredGlobal(config_pair.first,
config_pair.second);
continue;
}
```
lists might not be complete. need to check.
only few parameters are checked - one is valid-lifetime:
```plaintext
void
sanityChecks(const SrvConfigPtr& cfg, const ConstElementPtr& global) {
/// Global lifetime sanity checks
cfg->sanityChecksLifetime("valid-lifetime");
/// Shared network sanity checks
const SharedNetwork4Collection* networks = cfg->getCfgSharedNetworks4()->getAll();
if (networks) {
sharedNetworksSanityChecks(*networks, global->get("shared-networks"));
}
}
```
some are not checked even by processDhcp\[4|6\]Config:
```plaintext
if (allow_packet_park) {
// Get the parking limit. Parsing should ensure the value is present.
uint32_t parked_packet_limit = 0;
data::ConstElementPtr ppl = CfgMgr::instance().getCurrentCfg()->
getConfiguredGlobal(CfgGlobals::PARKED_PACKET_LIMIT);
if (ppl) {
parked_packet_limit = ppl->intValue();
}
if (parked_packet_limit) {
auto const& parking_lot =
ServerHooks::getServerHooks().getParkingLotPtr(hook_label);
if (parking_lot && (parking_lot->size() >= parked_packet_limit)) {
// We can't park it so we're going to throw it on the floor.
LOG_DEBUG(packet4_logger, DBGLVL_PKT_HANDLING, parking_lot_full_msg)
.arg(parked_packet_limit)
.arg(query->getLabel());
isc::stats::StatsMgr::instance().addValue("pkt4-receive-drop",
static_cast<int64_t>(1));
rsp.reset();
return;
}
}
```backloghttps://gitlab.isc.org/isc-projects/kea/-/issues/3223kea v4 returns status-get 0 when not connected to database2024-02-21T09:17:05ZMarcin Godzinakea v4 returns status-get 0 when not connected to databaseDuring the missing lease database connection process, we send 'status-'get' to Kea.
Kea v6 returns:
```
{
"result": 1,
"text": "Error during command processing: no current lease manager is available"
}
```
Kea v4 returns norm...During the missing lease database connection process, we send 'status-'get' to Kea.
Kea v6 returns:
```
{
"result": 1,
"text": "Error during command processing: no current lease manager is available"
}
```
Kea v4 returns normal status:
```
{
"arguments": {
"multi-threading-enabled": true,
(...)
"uptime": 4
},
"result": 0
}
```
Getting result 0 on kea4 is misleading when there is no database connection.
**These features should be included in tests `tests/dhcp/test_database.py::test_db_retry*`. Please inform QA about the merging solution for this issue.**next-stable-2.6https://gitlab.isc.org/isc-projects/kea/-/issues/3221Minor doc update: server limitations update after ping-check2024-03-20T11:29:29ZTomek MrugalskiMinor doc update: server limitations update after ping-checkThe section 8.12 (DHCPv4 server limitations) still claims this:
> _The DHCPv4 server does not verify that an assigned address is unused. According to RFC 2131, the allocating server should verify that an address is not used by sending a...The section 8.12 (DHCPv4 server limitations) still claims this:
> _The DHCPv4 server does not verify that an assigned address is unused. According to RFC 2131, the allocating server should verify that an address is not used by sending an ICMP echo request._
This is no longer true after ping-check was implemented.kea2.6.0https://gitlab.isc.org/isc-projects/kea/-/issues/3220Debian apt repository setup installs `apt-transport-https` dummy package2024-03-14T14:31:13ZDirk HeinrichsDebian apt repository setup installs `apt-transport-https` dummy packagePlease stop installing that package. It's a dummy since Debian Buster/Ubuntu 18.04.Please stop installing that package. It's a dummy since Debian Buster/Ubuntu 18.04.outstandingTomek MrugalskiTomek Mrugalskihttps://gitlab.isc.org/isc-projects/kea/-/issues/3219Implement RFC9527: Homenet DHCPv6 options2024-01-25T14:54:51ZTomek MrugalskiImplement RFC9527: Homenet DHCPv6 optionsA new set of three DHCPv6 options are being published in [RFC9527](https://www.rfc-editor.org/authors/rfc9527.html). If this link no longer works, it means the RFC is published.
The options' formats are reasonably simple (a 16-bits long...A new set of three DHCPv6 options are being published in [RFC9527](https://www.rfc-editor.org/authors/rfc9527.html). If this link no longer works, it means the RFC is published.
The options' formats are reasonably simple (a 16-bits long bit field + fqdn) and are DHCPv6 only. There's no special processing - normal ORO stuff, although the server will likely keep some values user specific (so will be used mainly as host reservation options).backloghttps://gitlab.isc.org/isc-projects/kea/-/issues/3218Kea dhcp v4 server ip reservation configuration using uuid-guid (dhcp option ...2024-03-26T13:17:34ZBenoit SansoniKea dhcp v4 server ip reservation configuration using uuid-guid (dhcp option 97; rfc 4578)Hi,
I would like to set a dhcp v4 reservation ip using "uuid-guid" (that correspond to dhcp option 97 / RFC 4578).
This is my current kea server configuration using an hardware address that works fine :
"reservations": [...Hi,
I would like to set a dhcp v4 reservation ip using "uuid-guid" (that correspond to dhcp option 97 / RFC 4578).
This is my current kea server configuration using an hardware address that works fine :
"reservations": [
{
"hostname": "board",
"hw-address": "01:02:03:04:05:06",
"ip-address": "192.168.0.2",
"option-data": [
{
"name": "boot-file-name",
"data": "file.bin"
}
]
},
When I replaced in this configuration the hw-address by "uuid-guid", the "uuid-guid" filed is not expected by kea dhcp server.
In the documentation I can see that the default host reservation identifiers are:
"host-reservation-identifiers": [ "circuit-id", "hw-address", "duid", "client-id" ]
Is the "uuid-guid" is supported for IP reservation ?
Is it a feature that will be developped in the future ?
If the reservation with "uuid-guid" identifier is supported, What should configuration need to be applied ?
Thanks in advance for your help
Benoitoutstandinghttps://gitlab.isc.org/isc-projects/kea/-/issues/3217Neighbor discovery for dhcpv62024-02-19T21:40:42ZVaclav MichalekNeighbor discovery for dhcpv6This is a request to implement IPv6 neighbor discovery mechanism (rfc4861) in DHCPv6 server to obtain MAC hardware addresses.
The method is also suggested in [related issue](https://gitlab.isc.org/isc-projects/kea/-/issues/1729 "Feature...This is a request to implement IPv6 neighbor discovery mechanism (rfc4861) in DHCPv6 server to obtain MAC hardware addresses.
The method is also suggested in [related issue](https://gitlab.isc.org/isc-projects/kea/-/issues/1729 "Feature request: DHCPv6 - use real MAC address from dhcp6 request (mac-sources=raw)").
**Is your feature request related to a problem? Please describe.**
The feature is needed for reliable host-based reservations and identification of DHCPv6 clients.
**Describe the solution you'd like**
Two new mac-source methods (query OS neighbor cache, neighbor discovery) are to be implemented.
```plaintext
"mac-sources": [ "neigh-cache", "neigh-discovery" ]
```
**Describe alternatives you've considered** At this time, there is no practical alternative.
**Funding its development** No funding.
**Participating in development** I am planning to write the code (though with no experience with Kea developement).
**Contacting you** ... E-mail in my profile.backloghttps://gitlab.isc.org/isc-projects/kea/-/issues/3216Setting YANG list elements with singlequotes in key values is not possible in...2024-01-18T14:58:00ZAndrei Pavelandrei@isc.orgSetting YANG list elements with singlequotes in key values is not possible in our unit testing frameworkOur internal NETCONF test framework in the form of `YangRepr`, particularly the `YangRepr::set` functionality does not support setting list elements that have singlequotes in the value of a key. This is because setting a node is done by ...Our internal NETCONF test framework in the form of `YangRepr`, particularly the `YangRepr::set` functionality does not support setting list elements that have singlequotes in the value of a key. This is because setting a node is done by providing the xpath as a plain string and singlequotes are used to delimit the value of the key, so upon finding a singlequote in the value, the libyang parser thinks the value ends sooner than it actually does and does not know what to do with the rest of the xpath.
This is not a problem in production code, because production code has no need for setting YANG nodes, but instead is only concerned with retrieving them from the sysrepo datastore.
The issue may become more prevalent if issue 3198 gets merged as it was written at the time this issue was created. It makes `data` a key which is more likely to contain a singlequote than other keys, which is also why this issue became obvious there. The issue occurred in unit tests.
```
[ RUN ] ConfigTestKeaV4.examples4
libyang[0]: Invalid character 0x73 ('s'), perhaps "'Error: here'" is supposed to be a function call.
config_unittests.cc:332: Failure
Failed
json = loadFile(path) threw type: N3isc4yang12NetconfErrorE, what: setting item 'nullopt' at '/kea-dhcp4-server:config/option-data[code='56'][space='dhcp4'][data='Error: here's a DHCPNAK!']': Session::setItem: Couldn't set '/kea-dhcp4-server:config/option-data[code='56'][space='dhcp4'][data='Error: here's a DHCPNAK!']': SR_ERR_INVAL_ARG
Google Test trace:
config_unittests.cc:330:
* Tested file: /home/andrei/work/isc/kea-3198-vivso-suboptions-not-properly-supported-in-netconf/doc/examples/kea4/all-options.json
[ FAILED ] ConfigTestKeaV4.examples4 (509 ms)
```
This change was done to avoid it:
```diff
diff --git a/doc/examples/kea4/all-options.json b/doc/examples/kea4/all-options.json
index 5e7d7ccbc7..f52105691b 100644
--- a/doc/examples/kea4/all-options.json
+++ b/doc/examples/kea4/all-options.json
@@ -691,3 +691,3 @@
"code": 56,
- "data": "Error: here's a DHCPNAK!",
+ "data": "Error: here is a DHCPNAK!",
"name": "dhcp-message"
```
One may think of encoding the singlequote as Kea does with the commas in user-context under the lease CSV files. That is not ideal, if even possible, since the singlequote would need to be decoded in get unctionality which means it has an effect on production code, but moreover it might not be compatible with setting outside `YangRepr`, via e.g. sysrepocfg.outstandinghttps://gitlab.isc.org/isc-projects/kea/-/issues/3215Changing the value of a key in a YANG list element creates a new node rather ...2024-01-25T14:52:44ZAndrei Pavelandrei@isc.orgChanging the value of a key in a YANG list element creates a new node rather than replacing itThe title may be over-generalizing, but I suspect not.
I experienced this issue with option-data for kea-dhcp4.
The issue manifests in master and 2.4.1 with sysrepo v2, but also in 2.2.1 with sysrepo v1.
The issue may become more prev...The title may be over-generalizing, but I suspect not.
I experienced this issue with option-data for kea-dhcp4.
The issue manifests in master and 2.4.1 with sysrepo v2, but also in 2.2.1 with sysrepo v1.
The issue may become more prevalent if issue 3198 gets merged as it was written at the time this issue was created. It makes `data` a key and that makes it more likely to have entries with only code, space and data (all keys), which is also why this issue became obvious there.
Replication:
1. Start kea-dhcp4 with a control-socket configured.
2. Start kea-netconf with the same control-socket configured under the `"dhcp4"` server.
3. Do a `sysrepocfg --edit=kea-dhcp4-config.xml` where `kea-dhcp4-config.xml` has this content:
```xml
<config xmlns="urn:ietf:params:xml:ns:yang:kea-dhcp4-server">
<control-socket>
<socket-name>/tmp/kea-dhcp4-ctrl.sock</socket-name>
<socket-type>unix</socket-type>
</control-socket>
<option-data>
<code>100</code>
<space>dhcp4</space>
<data>1234</data>
</option-data>
</config>
```
4. Run the command again with `<code>100</code>` changed to `<code>101</code>`.
Only one option was expected as specified in the XML, but there are two options as indicated by the kea-netconf logs:
```
DEBUG [kea-netconf.netconf] NETCONF_UPDATE_CONFIG updating configuration with dhcp4 server: {
"Dhcp4": {
"control-socket": {
"socket-name": "/tmp/kea-dhcp4-ctrl.sock",
"socket-type": "unix"
},
"option-data": [
{
"code": 100,
"data": "1234",
"space": "dhcp4"
},
{
"code": 101,
"data": "1234",
"space": "dhcp4"
}
]
}
}
INFO [kea-netconf.netconf] NETCONF_UPDATE_CONFIG_COMPLETED completed updating configuration for dhcp4 server
```
and by the response to a subsequent `config-get` command which contains:
```
"option-data": [
{
"always-send": false,
"code": 100,
"csv-format": true,
"data": "1234",
"name": "tcode",
"space": "dhcp4"
},
{
"always-send": false,
"code": 101,
"csv-format": true,
"data": "1234",
"name": "pcode",
"space": "dhcp4"
}
],
```https://gitlab.isc.org/isc-projects/kea/-/issues/3213Feature request: statistics-get-all-global command to get all of the global s...2024-03-27T12:51:29ZCathy AlmondFeature request: statistics-get-all-global command to get all of the global stats without any of the subnet stats---
name: statistics-get-all-global command
about: `statistics-get-all-global` command (or similar) to get all of the global statistics without any of the subnet statistics
---
It would also be useful to have something like "statistics...---
name: statistics-get-all-global command
about: `statistics-get-all-global` command (or similar) to get all of the global statistics without any of the subnet statistics
---
It would also be useful to have something like "statistics-get-all-global" command to get all of the global stats but not all of the subnet (or pool if they get added) stats. We have scenarios with multiple 100s of subnets and for those "get-all" can get unwieldy.
See [SF1429](https://isc.lightning.force.com/lightning/r/Case/5007V00002ZyA1sQAF/view)next-stable-3.0https://gitlab.isc.org/isc-projects/kea/-/issues/3206subnet-get commands should fetch leases for selected subnets with pagination2024-03-22T13:15:53ZMarcin Siodelskisubnet-get commands should fetch leases for selected subnets with paginationIn HA, we use lease commands to synchronize the database. The lease commands fetch all leases with pagination. However, in the hub-and-spoke model it would be useful to fetch the leases only for selected subnets because the relationships...In HA, we use lease commands to synchronize the database. The lease commands fetch all leases with pagination. However, in the hub-and-spoke model it would be useful to fetch the leases only for selected subnets because the relationships are partitioned by subnet. Today, all leases have to be fetched by each relationship and those that do not belong to the relationship are discarded. This is inefficient. One thing to consider is that subnet identifiers are listed explicitly in the commands.next-stable-3.0https://gitlab.isc.org/isc-projects/kea/-/issues/3203DHCPINFORM is only logged on DEBUG level2024-03-27T13:50:18ZBernhard SchmidtDHCPINFORM is only logged on DEBUG level**Describe the bug**
I'm currently working on a project to migrate a Windows DHCP server environment to Kea. Right now both are active and I'm looking at logs and tcpdump captures while fiddling with the config.
I got confused because ...**Describe the bug**
I'm currently working on a project to migrate a Windows DHCP server environment to Kea. Right now both are active and I'm looking at logs and tcpdump captures while fiddling with the config.
I got confused because there were DHCPACK messages originated by the Kea server while there was not a single log entry visible. Increasing the logging verbosity to DEBUG shows a large number of messages, all with severity DEBUG.
Kea should not interact with clients over the network without logging.
**To Reproduce**
Steps to reproduce the behavior:
1. Run Kea dhcpv4 with a logging config like https://gitlab.isc.org/isc-projects/kea/-/blob/master/doc/examples/kea4/single-subnet.json?ref_type=heads
2. have a client send DHCPINFORM while running tcpdump
3. observe a DHCPACK being generated in tcpdump with Kea not logging a single line
**Expected behavior**
At least one line should be logged on INFO level when Kea is receiving and answering a DHCPINFORM request.
**Environment:**
- Kea version: 2.4.1
- OS: Debian Bookworm
**Additional Information**
```
2024-01-02 20:14:36.523 DEBUG [kea-dhcp4.packets/1.140376903606784] DHCP4_BUFFER_RECEIVED received buffer from 10.1.0.142:68 to 255.255.255.255:67 over interface ens19
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.dhcpsrv/1.140376869664512] DHCPSRV_SUBNET4_SELECT_NO_RAI_OPTIONS No RAI options found to use for subnet selection.
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.dhcpsrv/1.140376869664512] DHCPSRV_SUBNET4_SELECT_NO_RELAY_ADDRESS Relay address (giaddr) in client packet is empty.
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.dhcpsrv/1.140376869664512] DHCPSRV_SUBNET4_SELECT_BY_INTERFACE_NO_MATCH No subnet matches interface: ens19
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.dhcpsrv/1.140376869664512] DHCPSRV_CFGMGR_SUBNET4_ADDR selected subnet 10.1.0.0/16 for packet received by matching address 10.1.4.1
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.packets/1.140376869664512] DHCP4_SUBNET_SELECTED [hwtype=1 ee:bd:63:c3:73:93], cid=[01:ee:bd:63:c3:73:93], tid=0xfe6e0c6f: the subnet with ID 10001000 was selected for client assignments
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.packets/1.140376869664512] DHCP4_PACKET_RECEIVED [hwtype=1 ee:bd:63:c3:73:93], cid=[01:ee:bd:63:c3:73:93], tid=0xfe6e0c6f: DHCPINFORM (type 8) received from 10.1.0.142 to 255.255.255.255 on interface ens19
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.dhcpsrv/1.140376869664512] DHCPSRV_SUBNET4_SELECT_NO_RAI_OPTIONS No RAI options found to use for subnet selection.
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.dhcpsrv/1.140376869664512] DHCPSRV_SUBNET4_SELECT_NO_RELAY_ADDRESS Relay address (giaddr) in client packet is empty.
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.dhcpsrv/1.140376869664512] DHCPSRV_SUBNET4_SELECT_BY_INTERFACE_NO_MATCH No subnet matches interface: ens19
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.dhcpsrv/1.140376869664512] DHCPSRV_CFGMGR_SUBNET4_ADDR selected subnet 10.1.0.0/16 for packet received by matching address 10.1.4.1
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.packets/1.140376869664512] DHCP4_SUBNET_SELECTED [hwtype=1 ee:bd:63:c3:73:93], cid=[01:ee:bd:63:c3:73:93], tid=0xfe6e0c6f: the subnet with ID 10001000 was selected for client assignments
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.hosts/1.140376869664512] HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER get one host with IPv4 reservation for subnet id 0, identified by hwaddr=EEBD63C37393
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.hosts/1.140376869664512] HOSTS_CFG_GET_ALL_IDENTIFIER get all hosts with reservations using identifier: hwaddr=EEBD63C37393
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.hosts/1.140376869664512] HOSTS_CFG_GET_ALL_IDENTIFIER_COUNT using identifier hwaddr=EEBD63C37393, found 1 host(s)
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.hosts/1.140376869664512] HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER_NULL host not found using subnet id 0 and identifier hwaddr=EEBD63C37393
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.hosts/1.140376869664512] HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER get one host with IPv4 reservation for subnet id 0, identified by client-id=01EEBD63C37393
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.hosts/1.140376869664512] HOSTS_CFG_GET_ALL_IDENTIFIER get all hosts with reservations using identifier: client-id=01EEBD63C37393
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.hosts/1.140376869664512] HOSTS_CFG_GET_ALL_IDENTIFIER_COUNT using identifier client-id=01EEBD63C37393, found 0 host(s)
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.hosts/1.140376869664512] HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER_NULL host not found using subnet id 0 and identifier client-id=01EEBD63C37393
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.hosts/1.140376869664512] HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER get one host with IPv4 reservation for subnet id 10001000, identified by hwaddr=EEBD63C37393
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.hosts/1.140376869664512] HOSTS_CFG_GET_ALL_IDENTIFIER get all hosts with reservations using identifier: hwaddr=EEBD63C37393
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.hosts/1.140376869664512] HOSTS_CFG_GET_ALL_IDENTIFIER_COUNT using identifier hwaddr=EEBD63C37393, found 1 host(s)
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.hosts/1.140376869664512] HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER_HOST using subnet id 10001000 and identifier hwaddr=EEBD63C37393, found host: hwaddr=EEBD63C37393 ipv4_subnet_id=10001000 hostname=(empty) ipv4_reservation=10.1.0.142 siaddr=(no) sname=(empty) file=(empty) key=(empty) ipv6_reservations=(none)
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.dhcp4/1.140376869664512] DHCP4_CLASS_ASSIGNED [hwtype=1 ee:bd:63:c3:73:93], cid=[01:ee:bd:63:c3:73:93], tid=0xfe6e0c6f: client packet has been assigned to the following class(es): KNOWN
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.dhcp4/1.140376869664512] DHCP4_CLASS_ASSIGNED [hwtype=1 ee:bd:63:c3:73:93], cid=[01:ee:bd:63:c3:73:93], tid=0xfe6e0c6f: client packet has been assigned to the following class(es): ALL, VENDOR_CLASS_MSFT 5.0, KNOWN
dhcp4_1 | 2024-01-02 20:14:36.524 DEBUG [kea-dhcp4.packets/1.140376869664512] DHCP4_PACKET_SEND [hwtype=1 ee:bd:63:c3:73:93], cid=[01:ee:bd:63:c3:73:93], tid=0xfe6e0c6f: trying to send packet DHCPACK (type 5) from 10.1.4.1:67 to 10.1.0.142:68 on interface ens19
```kea2.6.0https://gitlab.isc.org/isc-projects/kea/-/issues/3202Mismatch in Kea DHCP Subnet Configuration: Unexpected Vendor Class Returned2024-01-25T14:52:06ZSandeep GagalapallyMismatch in Kea DHCP Subnet Configuration: Unexpected Vendor Class ReturnedWhen I create a subnet in Kea DHCP Database with client class as Vendor_C for the subnet 10.x.x.65/28. It should return the
Vendor_C class but I see data of Vendor_N returned everytime.
In other words I am expecting the DHCP server to ...When I create a subnet in Kea DHCP Database with client class as Vendor_C for the subnet 10.x.x.65/28. It should return the
Vendor_C class but I see data of Vendor_N returned everytime.
In other words I am expecting the DHCP server to return data sftp://ftp-server:password@ip_address/configs/Vendor_ztp_cen.xml
to the DHCP client but it is returning sftp://ftp-server:password@ip_address/configs/Vendor_ztp_ned.xml which is defined under Vendor_N.
## My Client classes Configuration defined on the DHCP server.
"client-classes": [
{
"name": "Vendor_N",
"test": "substring(option[60].hex,0,9) == 'Vendor'",
"option-data": [
{
"name": "boot-file-name",
"data": "sftp://ftp-server:password@ip_address/configs/Vendor_ztp_ned.xml"
},
{
"name": "domain-name-servers",
"data": "x.x.x.x,x.x.x.x"
}
]
},
{
"name": "Vendor_C",
"test": "substring(option[60].hex,0,9) == 'Vendor'",
"option-data": [
{
"name": "boot-file-name",
"data": "sftp://ftp-server:password@ip_address/configs/Vendor_ztp_cen.xml"
},
{
"name": "domain-name-servers",
"data": "x.x.x.x,x.x.x.x"
}
]
},
{
"name": "Vendor_W",
"test": "substring(option[60].hex,0,9) == 'Vendor'",
"option-data": [
{
"name": "boot-file-name",
"data": "sftp://ftp-server-pnp:password@ip_address/configs/Vendor_ztp_wst.xml"
},
{
"name": "domain-name-servers",
"data": "x.x.x.x,x.x.x.x"
}
]
}
]
## My Payload when adding a subnet##
{
"command": "remote-subnet4-set",
"service": ["dhcp4"],
"arguments": {
"subnets": [
{
"id": 12345,
"subnet": 10.x.x.65/28,
"shared-network-name": "",
"pools": [
{
"pool": "10.x.x.67- 10.x.x.79",
"require-client-classes": ["Vendor_C"]
} for pool in pools
],
"option-data": [
{
"name": "routers",
"data": 10.x.x.65
}
]
}
],
"remote": {
"type": "mysql"
},
"server-tags": ["all"]
}
}
# DHCP4 log messages
```
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string 'Vendor'
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_EQUAL Popping 0x44726976654E657473 and 0x44726976654E657473 pushing result 'true'
2024-01-02 10:58:30.387 INFO [kea-dhcp4.dhcpsrv/4457.140027448874752] EVAL_RESULT Expression Vendor_N evaluated to 1
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_OPTION Pushing option 60 with value 0x44726976654E6574732D5566695F53706163655F53393731302D3736442D522D31382E322E302E3137
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string '0'
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string '9'
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_SUBSTRING Popping length 9, start 0, string 0x44726976654E6574732D5566695F53706163655F53393731302D3736442D522D31382E322E302E3137 pushing result 0x44726976654E657473
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string 'Vendor'
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_EQUAL Popping 0x44726976654E657473 and 0x44726976654E657473 pushing result 'true'
2024-01-02 10:58:30.387 INFO [kea-dhcp4.dhcpsrv/4457.140027448874752] EVAL_RESULT Expression Vendor_C evaluated to 1
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_OPTION Pushing option 60 with value 0x44726976654E6574732D5566695F53706163655F53393731302D3736442D522D31382E322E302E3137
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string '0'
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string '9'
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_SUBSTRING Popping length 9, start 0, string 0x44726976654E6574732D5566695F53706163655F53393731302D3736442D522D31382E322E302E3137 pushing result 0x44726976654E657473
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string 'Vendor'
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_EQUAL Popping 0x44726976654E657473 and 0x44726976654E657473 pushing result 'true'
2024-01-02 10:58:30.387 INFO [kea-dhcp4.dhcpsrv/4457.140027448874752] EVAL_RESULT Expression Vendor_W evaluated to 1
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.packets/4457.140027448874752] DHCP4_PACKET_RECEIVED [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: DHCPREQUEST (type 3) received from 10.x.x.37 to 100.91.x.x on interface ens160
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.packets/4457.140027448874752] DHCP4_QUERY_DATA [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5, packet details: local_address=100.x.x.226:67, remote_address=10.x.x.37:68, msg_type=DHCPREQUEST (3), transid=0x758adfb5,
options:
type=012, len=015: "WKY1C7VH0001AP2" (string)
type=053, len=001: 3 (uint8)
type=055, len=015: 1(uint8) 121(uint8) 3(uint8) 6(uint8) 12(uint8) 15(uint8) 28(uint8) 33(uint8) 51(uint8) 54(uint8) 58(uint8) 59(uint8) 66(uint8) 67(uint8) 119(uint8)
type=057, len=002: 8972 (uint16)
type=060, len=041: "Vendor-Ufi_Space_S9710-76D-R-18.2.0.17" (string)
type=061, len=020: 00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32
type=124, len=21, enterprise id=0xc24b, data-len0=16, vendor-class-data0='Vendor-BaseOS'
type=145, len=001: 01
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.dhcpsrv/4457.140027448874752] DHCPSRV_SUBNET4_SELECT_NO_RAI_OPTIONS No RAI options found to use for subnet selection.
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.dhcpsrv/4457.140027448874752] DHCPSRV_SUBNET4_SELECT_NO_RELAY_ADDRESS Relay address (giaddr) in client packet is empty.
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.dhcpsrv/4457.140027448874752] DHCPSRV_CFGMGR_SUBNET4_ADDR selected subnet 10.28.16.33/28 for packet received by matching address 10.x.x.37
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.packets/4457.140027448874752] DHCP4_SUBNET_SELECTED [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: the subnet with ID 2406630306 was selected for client assignments
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.packets/4457.140027448874752] DHCP4_SUBNET_DATA [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: the selected subnet details: 10.28.16.33/28
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER get one host with IPv4 reservation for subnet id 2406630306, identified by hwaddr=8440761A7A39
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ALL_IDENTIFIER get all hosts with reservations using identifier: hwaddr=8440761A7A39
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ALL_IDENTIFIER_COUNT using identifier hwaddr=8440761A7A39, found 0 host(s)
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER_NULL host not found using subnet id 2406630306 and identifier hwaddr=8440761A7A39
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER get one host with IPv4 reservation for subnet id 2406630306, identified by client-id=006E63632D574B59314337564830303031415032
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ALL_IDENTIFIER get all hosts with reservations using identifier: client-id=006E63632D574B59314337564830303031415032
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ALL_IDENTIFIER_COUNT using identifier client-id=006E63632D574B59314337564830303031415032, found 0 host(s)
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER_NULL host not found using subnet id 2406630306 and identifier client-id=006E63632D574B59314337564830303031415032
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.dhcp4/4457.140027448874752] DHCP4_CLASS_ASSIGNED [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: client packet has been assigned to the following class(es): UNKNOWN
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.dhcp4/4457.140027448874752] DHCP4_CLASS_ASSIGNED [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: client packet has been assigned to the following class(es): ALL, HA_prod-kea-1, VENDOR_CLASS_Vendor-Ufi_Space_S9710-76D-R-18.2.0.17, Vendor_N, Vendor_C, Vendor_W, UNKNOWN
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.ddns/4457.140027448874752] DHCP4_CLIENT_HOSTNAME_PROCESS [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: processing client's Hostname option
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.ddns/4457.140027448874752] DHCP4_CLIENT_HOSTNAME_DATA [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: client sent Hostname option: WKY1C7VH0001AP2
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.ddns/4457.140027448874752] DHCP4_CLIENT_HOSTNAME_DATA [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: client sent Hostname option: WKY1C7VH0001AP2
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.ddns/4457.140027448874752] DHCP4_RESPONSE_HOSTNAME_DATA [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: including Hostname option in the server's response: wky1c7vh0001ap2
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.dhcpsrv/4457.140027448874752] DHCPSRV_MYSQL_GET_CLIENTID obtaining IPv4 leases for client ID 00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32
2024-01-02 10:58:30.461 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS4 get one host with reservation for subnet id 2406630306 and IPv4 address 10.x.x.37
2024-01-02 10:58:30.461 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ALL_ADDRESS4 get all hosts with reservations for IPv4 address 10.x.x.37
2024-01-02 10:58:30.461 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ALL_ADDRESS4_COUNT using address 10.x.x.37, found 0 host(s)
2024-01-02 10:58:30.461 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS4_NULL host not found using subnet id 2406630306 and address 10.x.x.37
2024-01-02 10:58:30.461 DEBUG [kea-dhcp4.dhcpsrv/4457.140027448874752] DHCPSRV_MYSQL_GET_ADDR4 obtaining IPv4 lease for address 10.x.x.37
2024-01-02 10:58:30.535 DEBUG [kea-dhcp4.alloc-engine/4457.140027448874752] ALLOC_ENGINE_V4_REQUEST_EXTEND_LEASE [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: extending lifetime of the lease for address 10.x.x.37
2024-01-02 10:58:30.535 DEBUG [kea-dhcp4.dhcpsrv/4457.140027448874752] DHCPSRV_MYSQL_UPDATE_ADDR4 updating IPv4 lease for address 10.x.x.37
2024-01-02 10:58:30.611 INFO [kea-dhcp4.leases/4457.140027448874752] DHCP4_LEASE_ALLOC [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: lease 10.x.x.37 has been allocated for 43200 seconds
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_OPTION Pushing option 60 with value 0x44726976654E6574732D5566695F53706163655F53393731302D3736442D522D31382E322E302E3137
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string '0'
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string '9'
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_SUBSTRING Popping length 9, start 0, string 0x44726976654E6574732D5566695F53706163655F53393731302D3736442D522D31382E322E302E3137 pushing result 0x44726976654E657473
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string 'Vendor'
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_EQUAL Popping 0x44726976654E657473 and 0x44726976654E657473 pushing result 'true'
2024-01-02 10:58:30.611 INFO [kea-dhcp4.dhcp4/4457.140027448874752] EVAL_RESULT Expression Vendor_C evaluated to 1
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.callouts/4457.140027448874752] HOOKS_CALLOUTS_BEGIN begin all callouts for hook leases4_committed
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.callouts/4457.140027448874752] HOOKS_CALLOUT_CALLED hooks library with index 8 has called a callout on hook leases4_committed that has address 0x7f5ab16500f0 (callout duration: 0.034 ms)
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.callouts/4457.140027448874752] HOOKS_CALLOUTS_COMPLETE completed callouts for hook leases4_committed (total callouts duration: 0.034 ms)
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.options/4457.140027448874752] DHCP4_PACKET_PACK [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: preparing on-wire format of the packet to be sent
2024-01-02 10:55:29.629 DEBUG [kea-dhcp4.packets/4457.140027482445568] DHCP4_RESPONSE_DATA [hwtype=1 84:c4:21:1e:c0:fc], cid=[00:63:6c:75:73:74:65:72:2d:57:4b:59:31:43:38:56:4e:30:30:30:31:38:50:32:5f:77:61], tid=0x2252e631: responding with packet DHCPACK (type 5), packet details: local_address=100.91.x.x:67, remote_address=10.28.x.x:68, msg_type=DHCPACK (5), transid=0x2252e631,
options:
type=001, len=004: 4294967280 (uint32)
type=003, len=004: 10.x.x.33
type=006, len=008: x.x.x.x x.x.x.x
type=051, len=004: 43200 (uint32)
type=053, len=001: 5 (uint8)
type=054, len=004: 100.x.x.x
type=058, len=004: 21600 (uint32)
type=059, len=004: 32400 (uint32)
type=061, len=027: 00:63:6c:75:73:74:65:72:2d:57:4b:59:31:43:38:56:4e:30:30:30:31:38:50:32:5f:77:61
type=067, len=075: "sftp://ftp-server:password@ip_address/configs/vendor_ztp_ned.xml" (string)
```
Thanks,
Sandeepoutstandinghttps://gitlab.isc.org/isc-projects/kea/-/issues/3201Allow static leases by hostname like in the old ISC dhcpd2024-01-18T14:52:27ZLuigi BaldoniAllow static leases by hostname like in the old ISC dhcpd---
name: Allow reservations by hostname
about: Allow creating reservations by hostname like in the old ISC dhcp server
---
**Describe the solution you'd like**
In the old ISC dhcpd one could add entries like:
```
host myhost {
hard...---
name: Allow reservations by hostname
about: Allow creating reservations by hostname like in the old ISC dhcp server
---
**Describe the solution you'd like**
In the old ISC dhcpd one could add entries like:
```
host myhost {
hardware ethernet 08:00:aa:bb:cc:dd;
fixed-address myhost;
}
```
Kea allows this:
```
"reservations": [
{
"hw-address": "08:00:aa:bb:cc:dd",
"ip-address": "192.0.2.10"
}
]
```
Would it be possible to implement this feature in Kea so to have something like:
```
"reservations": [
{
"hw-address": "08:00:aa:bb:cc:dd",
"hostname-address": "myhost"
}
]
```
?
**Describe alternatives you've considered**
I am aware of the possibility of using ddns and RFC2136 to supply data to a domain name server.outstandinghttps://gitlab.isc.org/isc-projects/kea/-/issues/3200Kea unable to remove pid file on exit when installed via rpm2024-03-28T12:35:45ZWlodzimierz WencelKea unable to remove pid file on exit when installed via rpmjournal:
```
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal systemd[1]: Started kea-dhcp6.service - Kea DHCPv6 Service.
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: INFO HOSTS_BACKENDS_REGISTERED the following host backend ...journal:
```
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal systemd[1]: Started kea-dhcp6.service - Kea DHCPv6 Service.
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: INFO HOSTS_BACKENDS_REGISTERED the following host backend types are available: mysql postgresql
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: WARN DHCPSRV_MT_DISABLED_QUEUE_CONTROL disabling dhcp queue control when multi-threading is enabled.
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: WARN DHCP6_RESERVATIONS_LOOKUP_FIRST_ENABLED Multi-threading is enabled and host reservations lookup is always perfo>
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: INFO DHCPSRV_CFGMGR_NEW_SUBNET6 a new subnet has been added to configuration: 2001:db8:1::/64 with params: t1=1000, >
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: INFO DHCPSRV_CFGMGR_SOCKET_TYPE_SELECT using socket type raw
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: INFO COMMAND_ACCEPTOR_START Starting to accept connections via unix domain socket bound to /tmp/kea6-ctrl-socket
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: INFO DHCP6_CONFIG_COMPLETE DHCPv6 server has completed configuration: added IPv6 subnets: 1; DDNS: disabled
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: INFO DHCPSRV_MEMFILE_DB opening memory file lease database: lfc-interval=3600 type=memfile universe=6
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: INFO DHCPSRV_MEMFILE_LEASE_FILE_LOAD loading leases from file /var/lib/kea/kea-leases6.csv
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: INFO DHCPSRV_MEMFILE_BUILD_EXTENDED_INFO_TABLES6 building extended info tables saw 0 leases, extended info sanity ch>
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: INFO DHCPSRV_MEMFILE_LFC_SETUP setting up the Lease File Cleanup interval to 3600 sec
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: INFO DHCP6_USING_SERVERID server is using server-id 00:01:00:01:2d:21:94:f1:0e:90:95:e1:82:d1 and stores in the file>
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: WARN DHCPSRV_NO_SOCKETS_OPEN no interface configured to listen to DHCP traffic
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: INFO DHCPSRV_CFGMGR_USE_ALLOCATOR using the iterative allocator for IA_NA leases in subnet 2001:db8:1::/64
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: INFO DHCPSRV_CFGMGR_USE_ALLOCATOR using the iterative allocator for IA_TA leases in subnet 2001:db8:1::/64
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: INFO DHCPSRV_CFGMGR_USE_ALLOCATOR using the iterative allocator for IA_PD leases in subnet 2001:db8:1::/64
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: WARN DHCP6_MULTI_THREADING_INFO enabled: yes, number of threads: 4, queue size: 64
Dec 29 14:32:17 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: INFO DHCP6_STARTED Kea DHCPv6 server version 2.5.5 started
Dec 29 14:34:21 ip-10-10-0-170.ec2.internal systemd[1]: Stopping kea-dhcp6.service - Kea DHCPv6 Service...
Dec 29 14:34:21 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: INFO DHCP6_SHUTDOWN server shutdown
Dec 29 14:34:21 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: terminate called after throwing an instance of 'isc::util::PIDFileError'
Dec 29 14:34:21 ip-10-10-0-170.ec2.internal kea-dhcp6[2900]: what(): Unable to delete PID file '/run/kea/kea-dhcp6.kea-dhcp6.pid'
Dec 29 14:34:22 ip-10-10-0-170.ec2.internal systemd[1]: kea-dhcp6.service: Main process exited, code=dumped, status=6/ABRT
Dec 29 14:34:22 ip-10-10-0-170.ec2.internal systemd[1]: kea-dhcp6.service: Failed with result 'core-dump'.
Dec 29 14:34:22 ip-10-10-0-170.ec2.internal systemd[1]: Stopped kea-dhcp6.service - Kea DHCPv6 Service.
Dec 29 14:34:54 ip-10-10-0-170.ec2.internal systemd[1]: Started kea-dhcp6.service - Kea DHCPv6 Service.
Dec 29 14:34:54 ip-10-10-0-170.ec2.internal (ea-dhcp6)[12118]: kea-dhcp6.service: Failed to set up special execution directory in /run: Permission denied
Dec 29 14:34:54 ip-10-10-0-170.ec2.internal (ea-dhcp6)[12118]: kea-dhcp6.service: Failed at step RUNTIME_DIRECTORY spawning /usr/sbin/kea-dhcp6: Permission denied
Dec 29 14:34:54 ip-10-10-0-170.ec2.internal systemd[1]: kea-dhcp6.service: Main process exited, code=exited, status=233/RUNTIME_DIRECTORY
Dec 29 14:34:54 ip-10-10-0-170.ec2.internal systemd[1]: kea-dhcp6.service: Failed with result 'exit-code'.
Dec 29 14:37:43 ip-10-10-0-170.ec2.internal systemd[1]: Started kea-dhcp6.service - Kea DHCPv6 Service.
Dec 29 14:37:43 ip-10-10-0-170.ec2.internal (ea-dhcp6)[12857]: kea-dhcp6.service: Failed to set up special execution directory in /run: Permission denied
Dec 29 14:37:43 ip-10-10-0-170.ec2.internal (ea-dhcp6)[12857]: kea-dhcp6.service: Failed at step RUNTIME_DIRECTORY spawning /usr/sbin/kea-dhcp6: Permission denied
Dec 29 14:37:43 ip-10-10-0-170.ec2.internal systemd[1]: kea-dhcp6.service: Main process exited, code=exited, status=233/RUNTIME_DIRECTORY
Dec 29 14:37:43 ip-10-10-0-170.ec2.internal systemd[1]: kea-dhcp6.service: Failed with result 'exit-code'.
```
probably packaging issue but it's up for investigation.kea2.6.0https://gitlab.isc.org/isc-projects/kea/-/issues/3199Minor Netconf documentation issue2024-01-11T15:07:21ZDarren AnkneyMinor Netconf documentation issueAs of the 2.4.1 version of the documentation, the ARM shows `output-options` in the example `kea-netconf` configurations found under https://kea.readthedocs.io/en/kea-2.4.1/arm/integrations.html#yang-netconf The `kea-netconf` daemon refu...As of the 2.4.1 version of the documentation, the ARM shows `output-options` in the example `kea-netconf` configurations found under https://kea.readthedocs.io/en/kea-2.4.1/arm/integrations.html#yang-netconf The `kea-netconf` daemon refuses to start until these are changed to `output_options` when using Kea 2.4.1 matching the version of the ARM.https://gitlab.isc.org/isc-projects/kea/-/issues/3198vivso-suboptions not properly supported in Netconf2024-01-26T10:58:09ZDarren Ankneyvivso-suboptions not properly supported in NetconfAn example of configuration of `vivso-suboptions` is shown in the ARM (simplified here):
```
"Dhcp4": {
"option-data": [
{
"name": "vivso-suboptions",
"space": "dhcp4",
"data": "2234"
...An example of configuration of `vivso-suboptions` is shown in the ARM (simplified here):
```
"Dhcp4": {
"option-data": [
{
"name": "vivso-suboptions",
"space": "dhcp4",
"data": "2234"
},
{
"name": "vivso-suboptions",
"space": "dhcp4",
"data": "3561"
},
...
]
}
```
In the Kea yang definition found in: src/share/yang/modules/kea-dhcp4-server@2023-06-28.yang the keys are "code space" as shown here:
```
grouping option-data-list {
description "Option data list grouping.";
list option-data {
key "code space";
description "Option data entry.";
leaf code {
type uint8;
mandatory true;
description "Option code.";
}
leaf space {
type string;
mandatory true;
description "Option space.";
}
uses dhcp:option-data-name;
uses dhcp:option-data-data;
uses dhcp:option-data-csv-format;
uses dhcp:option-data-always-send;
uses dhcp:option-data-never-send;
uses dhcp:option-data-user-context;
}
}
```
which makes it impossible to create two option-data entries with the same space (dhcp4) and code (125 for VIVSO). This is as stated in [RFC6020](https://datatracker.ietf.org/doc/html/rfc6020#section-7.8.2):
> The combined values of all the leafs specified in the key are used to uniquely identify a list entry. All key leafs MUST be given values when a list entry is created.
So this `sysrepocfg` xml works:
```
<config xmlns="urn:ietf:params:xml:ns:yang:kea-dhcp4-server">
<subnet4>
<id>1</id>
<pool>
<start-address>192.168.20.100</start-address>
<end-address>192.168.20.200</end-address>
</pool>
<subnet>192.168.20.0/24</subnet>
</subnet4>
<option-data>
<code>125</code>
<space>dhcp4</space>
<data>2234</data>
</option-data>
<interfaces-config>
<interfaces>enp0s3</interfaces>
</interfaces-config>
<control-socket>
<socket-name>/tmp/kea-dhcp4-ctrl.sock</socket-name>
<socket-type>unix</socket-type>
</control-socket>
</config>
```
while this, with second entry for option 125, does not:
```
<config xmlns="urn:ietf:params:xml:ns:yang:kea-dhcp4-server">
<subnet4>
<id>1</id>
<pool>
<start-address>192.168.20.100</start-address>
<end-address>192.168.20.200</end-address>
</pool>
<subnet>192.168.20.0/24</subnet>
</subnet4>
<option-data>
<code>125</code>
<space>dhcp4</space>
<data>2234</data>
<code>125</code>
<space>dhcp4</space>
<data>3561</data>
</option-data>
<interfaces-config>
<interfaces>enp0s3</interfaces>
</interfaces-config>
<control-socket>
<socket-name>/tmp/kea-dhcp4-ctrl.sock</socket-name>
<socket-type>unix</socket-type>
</control-socket>
</config>
```
When an attempt to apply the configuration is made, the output is as follows:
```
$ sudo sysrepocfg -v debug -d startup -f xml -m kea-dhcp4-server --edit=startup4.xml
[INF] Connection 52 created.
[INF] Session 20 (user "root", CID 52) created.
libyang error: Invalid position of the key "code" in a list. (Data location "/kea-dhcp4-server:config/option-data[code='125'][space='dhcp4']/code", line number 14.)
sysrepocfg error: Data parsing failed
[INF] No datastore changes to apply.
```
Please see [SF1556](https://isc.lightning.force.com/lightning/r/Case/500S6000002qbYdIAI/view) for further details including some proposed solutions.kea2.5.5Andrei Pavelandrei@isc.orgAndrei Pavelandrei@isc.orghttps://gitlab.isc.org/isc-projects/kea/-/issues/3197tftp-server-name (option 66) and boot-file-name (option 67)2024-01-11T14:56:42ZGavin McKeetftp-server-name (option 66) and boot-file-name (option 67)Hi,
Kea DHCPv4 server version 2.5.4
I am trying to provide a list of tftp servers and boot file names according to the ZTP requirements of MLXOS (Nvidia Infiniband switches)
https://docs.nvidia.com/networking/display/mlnxosv3111014/ge...Hi,
Kea DHCPv4 server version 2.5.4
I am trying to provide a list of tftp servers and boot file names according to the ZTP requirements of MLXOS (Nvidia Infiniband switches)
https://docs.nvidia.com/networking/display/mlnxosv3111014/getting+started#src-138809553_GettingStarted-RunningDHCP-ZTP
They state, that I must provide options in the following format.
```
option tftp-server-name "<image server url>, <config server url>, <docker container server url>";
option bootfile-name "<image file>, <config file>, <docker container file>";
```
When I define the Option config as follows
```
"option-data": [
{
// For each IPv4 subnet you most likely need to specify at
// least one router.
"name": "routers",
"data": "172.25.40.1"
},
{
"name": "domain-name-servers",
"data": "8.8.8.8"
},
{
"name": "cumulus-provision-url",
"data": "http://172.25.43.23:8080/scripts/nvue-ztp.py"
},
{
"name": "tftp-server-name",
"csv-format": true,
"data": "http://172.25.43.23:8080/mlxos,http://172.25.43.23:8080/configs/ib/,",
"space": "dhcp4"
},
{
"name": "boot-file-name",
"csv-format": true,
"data": "image-X86_64-3.11.1014.img,ib-config.conf,",
"space": "dhcp4"
}
]#
```
I only ever see the following offer on the wire, i.e the first URL and first file name.
![image](/uploads/1d85bf46828cc9fdcc58d3215ede969b/image.png)
I've exhasuitvely to override the Option definition, trying with type=record and record-types="string,string,string" nothing I do works.
Can someone advise if this is a bug? Or if there is a way to do this in Kea.backloghttps://gitlab.isc.org/isc-projects/kea/-/issues/3196Thread sanitizer warnings with std::bind2024-03-22T13:39:27ZMarcin SiodelskiThread sanitizer warnings with std::bindI ran a DHCPv4 server compiled with a thread sanitizer, and I got the following sporadic failure:
```
==================
WARNING: ThreadSanitizer: data race (pid=95142)
Write of size 8 at 0x7b0c0000c220 by main thread:
#0 operator ...I ran a DHCPv4 server compiled with a thread sanitizer, and I got the following sporadic failure:
```
==================
WARNING: ThreadSanitizer: data race (pid=95142)
Write of size 8 at 0x7b0c0000c220 by main thread:
#0 operator delete(void*, unsigned long) ../../../../src/libsanitizer/tsan/tsan_new_delete.cpp:150 (libtsan.so.0+0x8e878)
#1 std::_Function_base::_Base_manager<std::_Bind<void (isc::dhcp::Dhcpv4Srv::*(isc::dhcp::Dhcpv4Srv*, boost::shared_ptr<isc::dhcp::Pkt4>))(boost::shared_ptr<isc::dhcp::Pkt4>&)> >::_M_destroy(std::_Any_data&, std::integral_constant<bool, false>) /usr/include/c++/11/bits/std_function.h:175 (kea-dhcp4+0xbe1ab)
#2 std::_Function_base::_Base_manager<std::_Bind<void (isc::dhcp::Dhcpv4Srv::*(isc::dhcp::Dhcpv4Srv*, boost::shared_ptr<isc::dhcp::Pkt4>))(boost::shared_ptr<isc::dhcp::Pkt4>&)> >::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation) /usr/include/c++/11/bits/std_function.h:203 (kea-dhcp4+0xbe1ab)
#3 std::_Function_handler<void (), std::_Bind<void (isc::dhcp::Dhcpv4Srv::*(isc::dhcp::Dhcpv4Srv*, boost::shared_ptr<isc::dhcp::Pkt4>))(boost::shared_ptr<isc::dhcp::Pkt4>&)> >::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation) /usr/include/c++/11/bits/std_function.h:282 (kea-dhcp4+0xbe1ab)
#4 std::_Function_base::~_Function_base() /usr/include/c++/11/bits/std_function.h:244 (kea-dhcp4+0xbccd2)
#5 std::function<void ()>::~function() /usr/include/c++/11/bits/std_function.h:334 (kea-dhcp4+0xbccd2)
#6 boost::detail::sp_ms_deleter<std::function<void ()> >::destroy() /usr/include/boost/smart_ptr/make_shared_object.hpp:59 (kea-dhcp4+0xbccd2)
#7 boost::detail::sp_ms_deleter<std::function<void ()> >::operator()(std::function<void ()>*) /usr/include/boost/smart_ptr/make_shared_object.hpp:93 (kea-dhcp4+0xbccd2)
#8 boost::detail::sp_counted_impl_pd<std::function<void ()>*, boost::detail::sp_ms_deleter<std::function<void ()> > >::dispose() /usr/include/boost/smart_ptr/detail/sp_counted_impl.hpp:169 (kea-dhcp4+0xbccd2)
#9 boost::detail::sp_counted_base::release() /usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp:120 (kea-dhcp4+0x5420a)
#10 boost::detail::shared_count::~shared_count() /usr/include/boost/smart_ptr/detail/shared_count.hpp:432 (kea-dhcp4+0xb845a)
#11 boost::shared_ptr<std::function<void ()> >::~shared_ptr() /usr/include/boost/smart_ptr/shared_ptr.hpp:335 (kea-dhcp4+0xb845a)
#12 isc::dhcp::Dhcpv4Srv::runOne() /home/marcin/devel/kea/src/bin/dhcp4/dhcp4_srv.cc:1113 (kea-dhcp4+0xb845a)
#13 isc::dhcp::Dhcpv4Srv::run() /home/marcin/devel/kea/src/bin/dhcp4/dhcp4_srv.cc:1023 (kea-dhcp4+0xb87b7)
#14 main /home/marcin/devel/kea/src/bin/dhcp4/main.cc:282 (kea-dhcp4+0x5082a)
Previous read of size 8 at 0x7b0c0000c220 by thread T6:
#0 boost::shared_ptr<isc::hooks::CalloutHandle> isc::dhcp::getCalloutHandle<boost::shared_ptr<isc::dhcp::Pkt4> >(boost::shared_ptr<isc::dhcp::Pkt4> const&) ../../../src/lib/dhcpsrv/callout_handle_store.h:50 (kea-dhcp4+0xb7f7d)
#1 isc::dhcp::Dhcpv4Srv::processPacketAndSendResponse(boost::shared_ptr<isc::dhcp::Pkt4>&) /home/marcin/devel/kea/src/bin/dhcp4/dhcp4_srv.cc:1139 (kea-dhcp4+0xb7f7d)
#2 isc::dhcp::Dhcpv4Srv::processPacketAndSendResponseNoThrow(boost::shared_ptr<isc::dhcp::Pkt4>&) /home/marcin/devel/kea/src/bin/dhcp4/dhcp4_srv.cc:1122 (kea-dhcp4+0xb88c7)
#3 void std::__invoke_impl<void, void (isc::dhcp::Dhcpv4Srv::*&)(boost::shared_ptr<isc::dhcp::Pkt4>&), isc::dhcp::Dhcpv4Srv*&, boost::shared_ptr<isc::dhcp::Pkt4>&>(std::__invoke_memfun_deref, void (isc::dhcp::Dhcpv4Srv::*&)(boost::shared_ptr<isc::dhcp::Pkt4>&), isc::dhcp::Dhcpv4Srv*&, boost::shared_ptr<isc::dhcp::Pkt4>&) /usr/include/c++/11/bits/invoke.h:74 (kea-dhcp4+0xba3c9)
#4 std::__invoke_result<void (isc::dhcp::Dhcpv4Srv::*&)(boost::shared_ptr<isc::dhcp::Pkt4>&), isc::dhcp::Dhcpv4Srv*&, boost::shared_ptr<isc::dhcp::Pkt4>&>::type std::__invoke<void (isc::dhcp::Dhcpv4Srv::*&)(boost::shared_ptr<isc::dhcp::Pkt4>&), isc::dhcp::Dhcpv4Srv*&, boost::shared_ptr<isc::dhcp::Pkt4>&>(void (isc::dhcp::Dhcpv4Srv::*&)(boost::shared_ptr<isc::dhcp::Pkt4>&), isc::dhcp::Dhcpv4Srv*&, boost::shared_ptr<isc::dhcp::Pkt4>&) /usr/include/c++/11/bits/invoke.h:96 (kea-dhcp4+0xba3c9)
#5 void std::_Bind<void (isc::dhcp::Dhcpv4Srv::*(isc::dhcp::Dhcpv4Srv*, boost::shared_ptr<isc::dhcp::Pkt4>))(boost::shared_ptr<isc::dhcp::Pkt4>&)>::__call<void, , 0ul, 1ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul>) /usr/include/c++/11/functional:420 (kea-dhcp4+0xba3c9)
#6 void std::_Bind<void (isc::dhcp::Dhcpv4Srv::*(isc::dhcp::Dhcpv4Srv*, boost::shared_ptr<isc::dhcp::Pkt4>))(boost::shared_ptr<isc::dhcp::Pkt4>&)>::operator()<, void>() /usr/include/c++/11/functional:503 (kea-dhcp4+0xba3c9)
#7 void std::__invoke_impl<void, std::_Bind<void (isc::dhcp::Dhcpv4Srv::*(isc::dhcp::Dhcpv4Srv*, boost::shared_ptr<isc::dhcp::Pkt4>))(boost::shared_ptr<isc::dhcp::Pkt4>&)>&>(std::__invoke_other, std::_Bind<void (isc::dhcp::Dhcpv4Srv::*(isc::dhcp::Dhcpv4Srv*, boost::shared_ptr<isc::dhcp::Pkt4>))(boost::shared_ptr<isc::dhcp::Pkt4>&)>&) /usr/include/c++/11/bits/invoke.h:61 (kea-dhcp4+0xba3c9)
#8 std::enable_if<is_invocable_r_v<void, std::_Bind<void (isc::dhcp::Dhcpv4Srv::*(isc::dhcp::Dhcpv4Srv*, boost::shared_ptr<isc::dhcp::Pkt4>))(boost::shared_ptr<isc::dhcp::Pkt4>&)>&>, void>::type std::__invoke_r<void, std::_Bind<void (isc::dhcp::Dhcpv4Srv::*(isc::dhcp::Dhcpv4Srv*, boost::shared_ptr<isc::dhcp::Pkt4>))(boost::shared_ptr<isc::dhcp::Pkt4>&)>&>(std::_Bind<void (isc::dhcp::Dhcpv4Srv::*(isc::dhcp::Dhcpv4Srv*, boost::shared_ptr<isc::dhcp::Pkt4>))(boost::shared_ptr<isc::dhcp::Pkt4>&)>&) /usr/include/c++/11/bits/invoke.h:111 (kea-dhcp4+0xba3c9)
#9 std::_Function_handler<void (), std::_Bind<void (isc::dhcp::Dhcpv4Srv::*(isc::dhcp::Dhcpv4Srv*, boost::shared_ptr<isc::dhcp::Pkt4>))(boost::shared_ptr<isc::dhcp::Pkt4>&)> >::_M_invoke(std::_Any_data const&) /usr/include/c++/11/bits/std_function.h:290 (kea-dhcp4+0xba3c9)
#10 std::function<void ()>::operator()() const /usr/include/c++/11/bits/std_function.h:590 (libkea-util.so.80+0x3ef83)
#11 isc::util::ThreadPool<std::function<void ()>, std::deque<boost::shared_ptr<std::function<void ()> >, std::allocator<boost::shared_ptr<std::function<void ()> > > > >::run() ../../../src/lib/util/thread_pool.h:599 (libkea-util.so.80+0x3ef83)
Thread T6 (tid=95149, running) created by main thread at:
#0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x605b8)
#1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xdc328)
#2 isc::dhcp::ControlledDhcpv4Srv::processCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::shared_ptr<isc::data::Element const>) /home/marcin/devel/kea/src/bin/dhcp4/ctrl_dhcp4_srv.cc:861 (kea-dhcp4+0x666f8)
#3 isc::dhcp::ControlledDhcpv4Srv::loadConfigFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/marcin/devel/kea/src/bin/dhcp4/ctrl_dhcp4_srv.cc:163 (kea-dhcp4+0x6732b)
#4 isc::dhcp::ControlledDhcpv4Srv::init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/marcin/devel/kea/src/bin/dhcp4/ctrl_dhcp4_srv.cc:99 (kea-dhcp4+0x677fb)
#5 main /home/marcin/devel/kea/src/bin/dhcp4/main.cc:253 (kea-dhcp4+0x507e5)
SUMMARY: ThreadSanitizer: data race ../../../../src/libsanitizer/tsan/tsan_new_delete.cpp:150 in operator delete(void*, unsigned long)
==================
```
It looks that it may be related to using references to shared pointers in the functions passed to std::bind. Removing the reference seems to solve the problem. For example:
```patch
diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc
index 612e8aa58b..f949015c04 100644
--- a/src/bin/dhcp4/dhcp4_srv.cc
+++ b/src/bin/dhcp4/dhcp4_srv.cc
@@ -1117,7 +1117,7 @@ Dhcpv4Srv::runOne() {
}
void
-Dhcpv4Srv::processPacketAndSendResponseNoThrow(Pkt4Ptr& query) {
+Dhcpv4Srv::processPacketAndSendResponseNoThrow(Pkt4Ptr query) {
try {
processPacketAndSendResponse(query);
} catch (const std::exception& e) {
diff --git a/src/bin/dhcp4/dhcp4_srv.h b/src/bin/dhcp4/dhcp4_srv.h
index 0ed55adfe5..0507d73ab5 100644
--- a/src/bin/dhcp4/dhcp4_srv.h
+++ b/src/bin/dhcp4/dhcp4_srv.h
@@ -352,7 +352,7 @@ public:
/// methods, generates appropriate answer, sends the answer to the client.
///
/// @param query A pointer to the packet to be processed.
- void processPacketAndSendResponseNoThrow(Pkt4Ptr& query);
+ void processPacketAndSendResponseNoThrow(Pkt4Ptr query);
/// @brief Process an unparked DHCPv4 packet and sends the response.
///
```
However, we should probably go over all similar cases, not only this one. I've seen similar issues with other functions.kea2.5.8