Commit bab56ecb authored by Mikio Hara's avatar Mikio Hara Committed by Ian Lance Taylor

net: fix incorrect mode on ListenIP, ListenUDP

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5523044
parent c581ec49
......@@ -260,7 +260,7 @@ func ListenIP(netProto string, laddr *IPAddr) (c *IPConn, err error) {
default:
return nil, UnknownNetworkError(net)
}
fd, e := internetSocket(net, laddr.toAddr(), nil, syscall.SOCK_RAW, proto, "dial", sockaddrToIP)
fd, e := internetSocket(net, laddr.toAddr(), nil, syscall.SOCK_RAW, proto, "listen", sockaddrToIP)
if e != nil {
return nil, e
}
......
......@@ -233,7 +233,7 @@ func ListenUDP(net string, laddr *UDPAddr) (c *UDPConn, err error) {
if laddr == nil {
return nil, &OpError{"listen", "udp", nil, errMissingAddress}
}
fd, e := internetSocket(net, laddr.toAddr(), nil, syscall.SOCK_DGRAM, 0, "dial", sockaddrToUDP)
fd, e := internetSocket(net, laddr.toAddr(), nil, syscall.SOCK_DGRAM, 0, "listen", sockaddrToUDP)
if e != nil {
return nil, e
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment