mirror of
https://github.com/golang/go
synced 2024-11-22 22:40:02 -07:00
net: fix unixgram
The socket for AF_UNIX domain with SOCK_DGARM type isn't allowed to work with syscall listen. R=rsc CC=golang-dev https://golang.org/cl/7310068
This commit is contained in:
parent
482f3e8481
commit
a0430dae04
@ -54,7 +54,8 @@ func resolveAddr(op, net, addr string, deadline time.Time) (Addr, error) {
|
||||
//
|
||||
// Known networks are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only),
|
||||
// "udp", "udp4" (IPv4-only), "udp6" (IPv6-only), "ip", "ip4"
|
||||
// (IPv4-only), "ip6" (IPv6-only), "unix" and "unixpacket".
|
||||
// (IPv4-only), "ip6" (IPv6-only), "unix", "unixgram" and
|
||||
// "unixpacket".
|
||||
//
|
||||
// For TCP and UDP networks, addresses have the form host:port.
|
||||
// If host is a literal IPv6 address, it must be enclosed
|
||||
|
@ -93,8 +93,7 @@ func dialUnix(net string, laddr, raddr *UnixAddr, deadline time.Time) (*UnixConn
|
||||
type UnixListener struct{}
|
||||
|
||||
// ListenUnix announces on the Unix domain socket laddr and returns a
|
||||
// Unix listener. The network net must be "unix", "unixgram" or
|
||||
// "unixpacket".
|
||||
// Unix listener. The network net must be "unix" or "unixpacket".
|
||||
func ListenUnix(net string, laddr *UnixAddr) (*UnixListener, error) {
|
||||
return nil, syscall.EPLAN9
|
||||
}
|
||||
|
@ -251,11 +251,10 @@ type UnixListener struct {
|
||||
}
|
||||
|
||||
// ListenUnix announces on the Unix domain socket laddr and returns a
|
||||
// Unix listener. The network net must be "unix", "unixgram" or
|
||||
// "unixpacket".
|
||||
// Unix listener. The network net must be "unix" or "unixpacket".
|
||||
func ListenUnix(net string, laddr *UnixAddr) (*UnixListener, error) {
|
||||
switch net {
|
||||
case "unix", "unixgram", "unixpacket":
|
||||
case "unix", "unixpacket":
|
||||
default:
|
||||
return nil, UnknownNetworkError(net)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user