]> Cypherpunks repositories - gostls13.git/commitdiff
net: fix unixgram
authorMikio Hara <mikioh.mikioh@gmail.com>
Fri, 8 Feb 2013 23:18:32 +0000 (08:18 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Fri, 8 Feb 2013 23:18:32 +0000 (08:18 +0900)
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

src/pkg/net/dial.go
src/pkg/net/unixsock_plan9.go
src/pkg/net/unixsock_posix.go

index 409e8bbbb3894021b5e0cf8da951c0592990096b..82df35c340582830c03db19581639415d4a2f127 100644 (file)
@@ -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
index 713820c6659ad35786a44837e254219c763c8f8f..00a0be5b08c71dc37fa591de913202d7b32f6d04 100644 (file)
@@ -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
 }
index 34f3ffe73ae0061155a0c5fb426bc6406f76a206..6d6ce3f5e200ecdc7a774ae88fefe325e5488174 100644 (file)
@@ -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)
        }