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: Dial connects successfully to unreachable host #10186

Closed
brennerm opened this issue Mar 17, 2015 · 6 comments
Closed

net: Dial connects successfully to unreachable host #10186

brennerm opened this issue Mar 17, 2015 · 6 comments

Comments

@brennerm
Copy link

What does 'go version' print?

go version go1.4.2 darwin/amd64

What steps reproduce the problem?
http://play.golang.org/p/3Xm-GLcohL

What happened?
returned error is nil when dial any non-existent address.

What should have happened instead?
the error should not be nil.

Please provide any additional information below.

@ianlancetaylor
Copy link
Contributor

I can not recreate the problem on GNU/Linux with either tip or Go 1.4.

Can anybody else recreate it on OS X?

@mrekucci
Copy link

Also, I can not reproduce the problem on my Mac OS X 10.10.2.

@brennerm
Copy link
Author

Any further information needed from my side?

@mikioh mikioh changed the title net.Dial connects successfully to unreachable host net: Dial connects successfully to unreachable host Mar 17, 2015
@mikioh
Copy link
Contributor

mikioh commented Mar 17, 2015

exact same issue which is already closed

Not true.

conn, err := net.Dial("ip4:1", UNREACHABLE_HOST)

Please revisit what you are trying to do for which protocol and its transport characteristic.

@mikioh mikioh closed this as completed Mar 17, 2015
@mikioh
Copy link
Contributor

mikioh commented Mar 17, 2015

PS: If you need a bit handy ICMP stuff, see http://godoc.org/golang.org/x/net/icmp.
PPS: ICMP is pretty raw stuff, specifying destination address on transmission/source address on reception by connect syscall via Dial API is insufficient to control message exchange.
PPPS: #8276 is epoll, mostly Linux-specific issue. It never happens on platforms using another mech. such as kqueue, IOCP and event port.

@brennerm
Copy link
Author

Ok thanks for your support, guys.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
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

5 participants