You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull", "hg update default", rebuild, and
retry
what you did to
reproduce the problem. Thanks.
What steps will reproduce the problem?
1. Compile and run (as a Windows Administrator) the following code
package main
import "net"
import "fmt"
func main() {
_, err := net.ListenIP("ip4:blah", nil)
fmt.Println(err)
}
What is the expected output?
"dial ip4: protocol not supported"
What do you see instead?
"<nil>"
Which compiler are you using (5g, 6g, 8g, gccgo)?
8g
Which operating system are you using?
Windows XP, SP2
Which revision are you using? (hg identify)
gomingw, release "gowin32_release.r59"
Please provide any additional information below.
This actually reflects a bug in go/src/pkg/net/iprawsock.go, in which splitNetProto()
will never set err to anything, even when the protocol passed cannot be found. Instead,
for "ip4:blah" it returns ("ip4", 0, nil). On Linux, this results in
an error from socket() because there is no supported IP protocol number 0. On Windows
however, the socket() call fails, but with an invalid protocol number which ends up
creating weird packets on the network. This contributes to issue #2215, where no textual
protocols can be successfully looked up, so even "ip4:icmp" results in a
socket opened with protocol 0.
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: