Open Luap99 opened 3 years ago
In many places strings.Split(remote, ":") is used to split the ip and port. This does not work for ipv6 addresses.
strings.Split(remote, ":")
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
net.SplitHostPort
net.JoinHostPort
Very good point! ipv6 also deserves e2e tests I guess.
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 usenet.JoinHostPort
, https://pkg.go.dev/net#JoinHostPort