DHCPv6: pkt6 send failed: sendmsg() returned with an error: Message too long
Describe the bug I have IoT endpoints which get their IPv6 address via a relay and using rapid-commit. Due to the nature of the IoT network, those devices will reconnect to the network pretty often and asks for a DHCPv6 address each time either via the same relay or another one (meaning the endpoint will receive a v6 address from a different subnet).
After sometimes (I wasn't able to identify any specific trigger yet), KEA will stop replying to the requests and will start logging the following error message:
2021-03-24 16:12:30.289 INFO [kea-dhcp6.leases/1] DHCP6_LEASE_ALLOC duid=[00:03:00:06:74:88:bb:10:00:ea:b3:3e], tid=0x53cf3f: lease for address fd12:0:0:2::3 and iaid=0 has been allocated for 2592000 seconds
2021-03-24 16:12:30.289 WARN [kea-dhcp6.alloc-engine/1] ALLOC_ENGINE_V6_ALLOC_FAIL duid=[00:03:00:06:74:88:bb:10:00:ea:b3:3e], tid=0x53cf3f: failed to allocate an IPv6 address after 0 attempt(s)
2021-03-24 16:12:30.290 ERROR [kea-dhcp6.packets/1] DHCP6_PACKET_SEND_FAIL failed to send DHCPv6 packet: pkt6 send failed: sendmsg() returned with an error: Message too long
The Warning message can be ignored and is due because the endpoints ask for IPv6 PD and KEA is not configured with any.
At this point, the only way to recover is to delete the leases csv file and restart the DHCP server. It will recreate a new one and load the previous leases from kea-leases6.csv.2
To Reproduce
- Run Kea dhcpv6 daemon. (kea-dhcp6.conf)
- The IoT endpoints sends a DHCPv6 solicit which is relayed by a router
- Initially, the server does the address allocation and sends its reply to the relay
- After sometime, the server stops replying to the relays and log the "Message too long" error.
Expected behavior The server should be able to reply to a valid DHCPv6 sollicit in a consistent and reliable way.
Environment:
- Kea version: 1.6.3
- OS: Ubuntu 20.04 (based layer for a docker image deployed on a Centos7 host)
- Leases DB: memfile
Additional Information
- kea-leases6.csv lease file when the issue is happening: kea-leases6.csv
- kea-leases6.csv.2 lease file when the issue is happening: kea-leases6.csv.2
Contacting you e-mail