Kea IPv6: can't initially bind to link-local address, error isn't clearly actionable
Describe the bug Implementing Kea DHCP in a Docker container, initial startup results in dhcp6 "active" but not listening or responsive due to attempt to bind to link-local IPv6 address.
Message: WARN [kea-dhcp6.dhcpsrv/44.140567258032256] DHCPSRV_OPEN_SOCKET_FAIL failed to open socket: Failed to open link-local socket on interface eth0: Failed to bind socket 12 to fe80::b47a:f100:1fa6:671e/port=547: Cannot assign requested address
The only way to automate a test for this state is to process the log. The dhcp6 process continues to run but is not operational. A keactrl stop dhcp6; keactrl start dhcp6
seems to fix the issue.
To Reproduce Steps to reproduce the behavior:
- Configuration including dhcpv6; starting with
keactrl start
. Interface eth0 defined in configuration. - DHCPv4 server starts normally. DHCP6 server starts, fails.
Expected behavior
Two levels of difficulty: first, why does this error occur (possibly related to issues/321?). Second, the process does not die, making it difficult to detect. Process is "started" even though:
2021-11-29 01:02:22.946 WARN [kea-dhcp6.dhcp6/44.140564753819776] DHCP6_MULTI_THREADING_INFO enabled: no, number of threads: 0, queue size: 0 2021-11-29 01:02:22.946 INFO [kea-dhcp6.dhcp6/44.140564753819776] DHCP6_STARTED Kea DHCPv6 server version 2.0.0 started
Environment:
- Kea version: 2.0.0 general distribution.
- OS: CentOS 7, docker container
- No changes made to default configure script.
Additional Information Build Dockerfile
Build/run docker-compose.yml
Sanitized/excerpted kea-dhcp6.conf
Init script in container init_kea
Contacting you I'm not primarily a dev, so I've perhaps left something out; contact kmp@kmpeterson.com or associated github address. I do have a (horrible, as you can see) workaround for this, not high priority. Thanks!