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: UnixListener.AcceptUnix returns a UnixConn with incorrect network type string #7183

Closed
jgennis opened this issue Jan 22, 2014 · 4 comments
Milestone

Comments

@jgennis
Copy link

jgennis commented Jan 22, 2014

What steps will reproduce the problem?

Run the code at http://play.golang.org/p/FJBS8MOF72 on a system supporting the
"unixpacket" network type (not play.golang.org).

What is the expected output?

unixpacket
unixpacket
unixpacket

What do you see instead?

unixpacket
unix
unix

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

6g

Which operating system are you using?

Linux

Which version are you using?  (run 'go version')

go version go1.2 linux/amd64

Please provide any additional information below.

It looks like the problem is that UnixListener.AcceptUnix unconditionally passes
sockaddrToUnix to the fd.accept() call that it makes.  I'm guessing that it should
instead pass either sockaddrToUnix or sockaddrToUnixpacket based on the network type of
the listener.

Note that the underlying socket appears to be the correct type.  It's just the reported
*Addr().Network() strings that are wrong.
@mikioh
Copy link
Contributor

mikioh commented Jan 22, 2014

Comment 1:

Labels changed: added release-go1.3.

Status changed to Accepted.

@mikioh
Copy link
Contributor

mikioh commented Jan 23, 2014

Comment 2:

Labels changed: added repo-main.

@mikioh
Copy link
Contributor

mikioh commented Jan 29, 2014

Comment 3:

This issue was closed by revision 731e6f7.

Status changed to Fixed.

@gopherbot
Copy link

Comment 4:

CL https://golang.org/cl/105100046 mentions this issue.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
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

4 participants