net: Remove Solaris-specific version of listenerSockaddr.
Solaris will use the version in sock_unix.go. From-SVN: r201183
This commit is contained in:
parent
6212cdcdf7
commit
da8091da1b
@ -16,32 +16,3 @@ func maxListenerBacklog() int {
|
||||
// The kernel does not track the limit.
|
||||
return syscall.SOMAXCONN
|
||||
}
|
||||
|
||||
func listenerSockaddr(s, f int, la syscall.Sockaddr, toAddr func(syscall.Sockaddr) Addr) (syscall.Sockaddr, error) {
|
||||
a := toAddr(la)
|
||||
if a == nil {
|
||||
return la, nil
|
||||
}
|
||||
switch v := a.(type) {
|
||||
case *TCPAddr, *UnixAddr:
|
||||
err := setDefaultListenerSockopts(s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
case *UDPAddr:
|
||||
if v.IP.IsMulticast() {
|
||||
err := setDefaultMulticastSockopts(s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
switch f {
|
||||
case syscall.AF_INET:
|
||||
v.IP = IPv4zero
|
||||
case syscall.AF_INET6:
|
||||
v.IP = IPv6unspecified
|
||||
}
|
||||
return v.sockaddr(f)
|
||||
}
|
||||
}
|
||||
return la, nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user