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

Comments

Projects
None yet
5 participants
@brennerm
Copy link

commented Mar 17, 2015

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

This comment has been minimized.

Copy link
Contributor

commented Mar 17, 2015

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

This comment has been minimized.

Copy link

commented Mar 17, 2015

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

@brennerm

This comment has been minimized.

Copy link
Author

commented Mar 17, 2015

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

This comment has been minimized.

Copy link
Contributor

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 Mar 17, 2015

@mikioh

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Author

commented Mar 18, 2015

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.
You can’t perform that action at this time.