Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: inaccurate docs about announcing or listening on all local addresses #17616

mikioh opened this issue Oct 26, 2016 · 3 comments


None yet
5 participants
Copy link

commented Oct 26, 2016

The current documentation says:

func Listen, ListenPacket, Listen{TCP,UDP,UP}

Listen listens on all available interfaces instead of just the interface with the given
host address. 

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.


This comment has been minimized.

Copy link

commented Nov 1, 2016

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.

@quentinmit quentinmit added this to the Go1.8 milestone Nov 1, 2016

@rsc rsc modified the milestones: Go1.9, Go1.8 Nov 11, 2016


This comment has been minimized.

Copy link
Contributor Author

commented Nov 17, 2016


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, or IPv6 loopback address. I personally don't want to see an issue like "the Addr method of net.Interface doesn't show but net.Listen("tcp", "") works perfectly. Is this a bug?"


This comment has been minimized.

Copy link

commented Jan 8, 2017

CL mentions this issue.

@bradfitz bradfitz modified the milestones: Go1.10, Go1.9 Jun 13, 2017

@gopherbot gopherbot closed this in 424b065 Jun 22, 2017

@golang golang locked and limited conversation to collaborators Jun 22, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.