ctrl agent: cannot listen on ipv6
Describe the bug
The kea control agent cannot listen on IPv6 addresses via the http-host
option. We've tried several IPv6 types (GUA, ULA, link local including interface scope) and notations (with brackets and without). For the notation without brackets, the agent silently does not listen at all on an IP address, the notation with brackets, a configuration parsing error occurs.
To Reproduce Steps to reproduce the behavior:
We're using a configuration e.g.
{
"Control-agent": {
"http-host": "$HOST",
"http-port": 8000
// ...
}
}
where $HOST
is
- (empty string) causes
ERROR [kea-ctrl-agent.dctl/433402.140592497919872] DCTL_PARSER_FAIL : Failed to convert to IP address:Failed to convert string to address '': Invalid argument
- http-host line does not exist: listens on 127.0.0.1:8000
-
2001:db8::1
causes about 10 log lines ofRROR [kea-ctrl-agent.dctl/433486.140500168120192] DCTL_PARSER_FAIL : unable to setup TCP acceptor for listening to the incoming HTTP requests: open: Permission denied
and does not listen on the IPv6. -
[2001:db8::1]
causes about 10 log lines ofERROR [kea-ctrl-agent.dctl/433528.140127554930560] DCTL_PARSER_FAIL : Failed to convert [2001:db8::1] to IP address:Failed to convert string to address '[2001:db8::1]': Invalid argument
and does not listen on the IPv6
Since we're also loading the HA module, we configure a list of peers with the bracketed IPv6 notation (non-bracketed causes parsing errors):
{
"Dhcp4": {
"hooks-libraries": [
{
"library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_lease_cmds.so",
"parameters": {}
},
{
"library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_ha.so",
"parameters": {
"high-availability": [
{
"this-server-name": "host1",
"mode": "hot-standby",
"heartbeat-delay": 10000,
"max-response-delay": 10000,
"max-ack-delay": 5000,
"max-unacked-clients": 5,
"peers": [
{
"name": "host1",
"url": "https://[2001:db8::1]:8000",
"trust-anchor": "/etc/kea/bundle.pem",
"cert-file": "/etc/kea/host.crt",
"key-file": "/etc/kea/host.key",
"auto-failover": true,
"basic-auth-user": "admin",
"basic-auth-password": "..."
# ...
},
{
"name": "host2",
"url": "https://[2001:db8::2]:8000",
"trust-anchor": "/etc/kea/bundle.pem",
"cert-file": "/etc/kea/host.crt",
"key-file": "/etc/kea/host.key",
"role": "standby",
"auto-failover": true,
"basic-auth-user": "admin",
"basic-auth-password": "..."
}
]
...
This configuration seems to be accepted correctly.
Expected behavior
We expect IPv6 to be fully supported for a top notch project like kea. Are we missing a configuration option?
Environment:
- Kea version: version 2.2.0
- OS: debian 11
- Which features were compiled in (in particular which backends)
- If/which hooks where loaded in: HA