net: inaccurate docs about announcing or listening on all local addresses #17616
Comments
I don't understand the question. I read the docs as saying "Listen without a host address listens on all possible addresses on all interfaces". I think it's unspecified whether it picks up changes to the host's interfaces after startup - on *nix I expect that it would, but I don't think we guarantee that. |
From architectural point of view, an IP address is basically assigned to a link (or an interface or network interface which is an attachment to the link), agree. But practically, there are implementations that have addresses not assigned to link or interface; for example, 127.0.0.1/8 or IPv6 loopback address. I personally don't want to see an issue like "the Addr method of net.Interface doesn't show 127.0.0.1/8 but net.Listen("tcp", "127.0.0.1:0") works perfectly. Is this a bug?" |
CL https://golang.org/cl/34876 mentions this issue. |
The current documentation says:
I think it provides inaccurate information. What happens when you move an interface address on network interface X to another? Does it break your application? (Please consider that how VRRP or CARP works) Actually it announcing or listening on
all local addresses
.The text was updated successfully, but these errors were encountered: