net: fix incorrect mode on ListenIP, ListenUDP

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5523044
This commit is contained in:
Mikio Hara 2012-01-05 09:44:25 -08:00 committed by Ian Lance Taylor
parent c581ec4918
commit bab56ecb4d
2 changed files with 2 additions and 2 deletions

View File

@ -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
}

View File

@ -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
}