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

LocalAddr does not return correct addr #2127

Closed
gopherbot opened this issue Aug 3, 2011 · 3 comments
Closed

LocalAddr does not return correct addr #2127

gopherbot opened this issue Aug 3, 2011 · 3 comments

Comments

@gopherbot
Copy link

by kasimir.g:

What steps will reproduce the problem?
1.  Create a server with the net pkg
2.  Connect to it with a client
3.  Print out the results of LocalAddr

What is the expected output?
2011/08/03 11:28:15 have connection with LocalAddr(): 127.0.0.1:54321

What do you see instead?
2011/08/03 11:28:15 have connection with LocalAddr(): 0.0.0.0:54321

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
GNU/Linux

Which revision are you using?  (hg identify)
3c21f37b25a3+ weekly/weekly.2011-07-19

Please provide any additional information below.
LocalAddr() does not respond with what is expected.  I have attached the server to
demonstrate this.  You can connect to the server with nc <ip> 54321 and it will
print out what IP address it believes is connecting from. 

I have also attached a patch file for the net pkg.  With this patch file enabled, the
output is correct.

Attachments:

  1. localaddr.patch (431 bytes)
  2. server.go (391 bytes)
@gopherbot
Copy link
Author

Comment 1 by kasimir.g:

This has the same (incorrect) result when using https://gist.github.com/1123209.

@rsc
Copy link
Contributor

rsc commented Aug 10, 2011

Comment 2:

Owner changed to @rsc.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Aug 16, 2011

Comment 3:

This issue was closed by revision c20ced9.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants