Open tamird opened 4 years ago
Just to record what was discussed. I believe the long term fix is to make tcpip.FullAddress carry a family similar to sockaddr_in/in6.
That's likely not going to be enough in all cases - you still can't tell if tcpip.Address("")
is a v4 or a v6.
I would personally like to see tcpip.Address finally stop being a string and instead be either:
type Address struct {
data [header.IPv6AddressSize]byte
v6 bool
}
or
type Address struct {
data [16]byte
length uint8
}
That will work too. But I think in general a FullAddress should carry the family. That should be an easier fix than changing tcpip.Address.
We should consider switching to https://pkg.go.dev/inet.af/netaddr. We would need a different type to represent unix addresses.
A friendly reminder that this issue had no activity for 120 days.
tcpip.Address is no longer used to represent unix addresses since https://github.com/google/gvisor/commit/8478fe0a277fd2581f8df5560a310daa7277ed15 and has the shape described in https://github.com/google/gvisor/issues/1556#issuecomment-573854879 since https://github.com/google/gvisor/commit/792ebbff8e828248ef3b547f529f077447d46396#diff-5275b0dfd85666a8969324583bfb3ea342831a4c69d8524c3f64326294d4f0e8.
it's possible there's nothing left to do here. @kevinGC if there's a bug tracking moving to netip.Addr
then this should be closed in favor of that bug.
A friendly reminder that this issue had no activity for 120 days.
This issue has been closed due to lack of activity.
There are TODOs still referencing this issue:
Search TODO
Both IPv4 and IPv6 "ANY" are modeled by the empty string, which means it is impossible to tell from outside of the
package tcpip
's interfaces if such "ANY" addresses are IPv4 or IPv6.This is a generalization of #1495.