gvisor-tap-vsock
gvisor-tap-vsock copied to clipboard
make code ipv6 safe
In many places strings.Split(remote, ":") is used to split the ip and port. This does not work for ipv6 addresses.
https://github.com/containers/gvisor-tap-vsock/blob/9d8e7a5c6c5ac56290da3d78c5cd65cc59fff98a/pkg/services/forwarder/ports.go#L53-L56
To make this work with ipv6 addresses net.SplitHostPort should be used, https://pkg.go.dev/net#SplitHostPort.
To combine a port with a ip address use net.JoinHostPort, https://pkg.go.dev/net#JoinHostPort
Very good point! ipv6 also deserves e2e tests I guess.