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

syscall: Recvfrom fails with "address family not supported by protocol family" if incorrect buffer provided #4352

Closed
gopherbot opened this issue Nov 6, 2012 · 6 comments

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 6, 2012

by apatrushev:

What steps will reproduce the problem?
1. http://play.golang.org/p/Twk04P1T37
2. Call ReadFromUDP with slice of length 0

What is the expected output?
IDNK. Maybe another error.

What do you see instead?
strange error message

Which compiler are you using (5g, 6g, 8g, gccgo)?
default "go build" compiler

Which operating system are you using?
Mac OS X

Which version are you using?  (run 'go version')
go version go1.0.3

Please provide any additional information below.
@mikioh
Copy link
Contributor

@mikioh mikioh commented Nov 7, 2012

Comment 1:

Sure, looks a bit strange.
When you pass a zero-length slice to net.ReadFrom/UDP,
underlying syscall.Recvfrom calls SYS_RECVFROM and gets 
error = 0 (read succeeded) with unfilled sender's socket 
address. That all-bit zero sockaddr is treated as unknown
address in syscall.Recvfrom and that's the reason why you 
have an error EAFNOSUPPORT.
@rsc
Copy link
Contributor

@rsc rsc commented Dec 10, 2012

Comment 2:

Labels changed: added size-m.

@rsc
Copy link
Contributor

@rsc rsc commented Dec 10, 2012

Comment 3:

Labels changed: added suggested.

@rsc
Copy link
Contributor

@rsc rsc commented Dec 30, 2012

Comment 4:

Labels changed: added priority-later, removed priority-triage.

Status changed to Accepted.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Jan 9, 2013

Comment 5 by jeff.allen:

CL 7058062 will solve this (just tested it).
@rsc
Copy link
Contributor

@rsc rsc commented Jan 30, 2013

Comment 6:

This issue was closed by revision 6563d86.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.