You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of commit 0b631022, vpnkit/forward/udp.go's makeUDP method and vpnkit/port.go's spec method do not appear to fully support IPv6 addresses.
Under Docker Desktop 3.6.0 (67351) on macOS, I had been trying to publish a UDP port to an IPv6 address but received the error too many colons in address:
$ docker run --rm --publish [::1]:8080:80/udp nginx:latest
docker: Error response from daemon: Ports are not available: unable to resolve frontend address for port docker-proxy-port-approver/approver-7121331846359289064 udp forward from ::1:8080 to 0.0.0.0:0: address ::1:8080: too many colons in address.
ERRO[0000] error waiting for container: context canceled
However, testing port creation with TCP suggests that despite what is documented, IPv6 TCP publish doesn't appear to fail, and, if it does, it doesn't do so in the same way that IPv6 UDP does above:
$ docker run --rm --publish [::1]:8080:80/tcp nginx:latest
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/08/20 05:06:12 [notice] 1#1: using the "epoll" event method
2021/08/20 05:06:12 [notice] 1#1: nginx/1.21.1
2021/08/20 05:06:12 [notice] 1#1: built by gcc 8.3.0 (Debian 8.3.0-6)
2021/08/20 05:06:12 [notice] 1#1: OS: Linux 5.10.47-linuxkit
2021/08/20 05:06:12 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2021/08/20 05:06:12 [notice] 1#1: start worker processes
2021/08/20 05:06:12 [notice] 1#1: start worker process 31
2021/08/20 05:06:12 [notice] 1#1: start worker process 32
2021/08/20 05:06:12 [notice] 1#1: start worker process 33
2021/08/20 05:06:12 [notice] 1#1: start worker process 34
2021/08/20 05:06:12 [notice] 1#1: start worker process 35
2021/08/20 05:06:12 [notice] 1#1: start worker process 36
Looking through the code, I believe the UDP-specific error is assembled from code in two files:
vpnkit/forward/udp.go which generates the "unable to resolve frontend address for port" text.
Looking at the tests associated with these two files, I applied the patch (udp-ipv6-tests.txt) to demonstrate that:
Round trip for the port spec representation fails for IPv6 addresses with both TCP and UDP:
--- FAIL: TestParseRoundTrip (0.00s)
/Users/philip/Source/External/docker/vpnkit/go/pkg/vpnkit/port_test.go:60: Cannot parse port spec: Failed to parse port spec: tcp:2001:db8::2:8443:tcp:2001:db8::1:443
Binding to a random port on an IPv6 address works for TCP but fails for UDP:
--- FAIL: TestRandomPortsUDP (0.00s)
/Users/philip/Source/External/docker/vpnkit/go/pkg/vpnkit/forward/ forward_test.go:304:
Error Trace: forward_test.go:304
Error: Received unexpected error:
address ::1:0: too many colons in address
unable to resolve frontend address for port udp forward from ::1:0 to ::1:2
github.com/moby/vpnkit/go/pkg/vpnkit/forward.makeUDP
/Users/philip/Source/External/docker/vpnkit/go/pkg/vpnkit/ forward/udp.go:19
github.com/moby/vpnkit/go/pkg/vpnkit/forward.Maker.Make
/Users/philip/Source/External/docker/vpnkit/go/pkg/vpnkit/ forward/forward.go:47
github.com/moby/vpnkit/go/pkg/vpnkit/ forward.TestRandomPortsUDP
/Users/philip/Source/External/docker/vpnkit/go/pkg/vpnkit/ forward/forward_test.go:303
testing.tRunner
/usr/local/Cellar/go/1.16.6/libexec/src/testing/ testing.go:1193
runtime.goexit
/usr/local/Cellar/go/1.16.6/libexec/src/runtime/ asm_amd64.s:1371
Test: TestRandomPortsUDP
Is the IPv6 UDP behavior observed here expected?
My Docker information is included for completeness:
As of commit
0b631022
,vpnkit/forward/udp.go
'smakeUDP
method andvpnkit/port.go
'sspec
method do not appear to fully support IPv6 addresses.Under Docker Desktop 3.6.0 (67351) on macOS, I had been trying to publish a UDP port to an IPv6 address but received the error
too many colons in address
:In triaging this, I found that IPv6 doesn't appear to be supported by the Docker daemon on macOS and (unsurprisingly) is not enabled on my Docker install:
However, testing port creation with TCP suggests that despite what is documented, IPv6 TCP publish doesn't appear to fail, and, if it does, it doesn't do so in the same way that IPv6 UDP does above:
Looking through the code, I believe the UDP-specific error is assembled from code in two files:
vpnkit/forward/udp.go
which generates the "unable to resolve frontend address for port" text.vpnkit/ports.go
which generates the "forwarded from" text.Looking at the tests associated with these two files, I applied the patch (udp-ipv6-tests.txt) to demonstrate that:
Is the IPv6 UDP behavior observed here expected?
My Docker information is included for completeness:
The text was updated successfully, but these errors were encountered: