mirror of
https://github.com/golang/go
synced 2024-11-21 21:04:41 -07:00
net: fix incorrect mode on ListenIP, ListenUDP
R=golang-dev, iant CC=golang-dev https://golang.org/cl/5523044
This commit is contained in:
parent
c581ec4918
commit
bab56ecb4d
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user