]> Cypherpunks repositories - gostls13.git/commitdiff
syscall, net: clean up socket stub for solaris
authorMikio Hara <mikioh.mikioh@gmail.com>
Wed, 12 Mar 2014 01:32:46 +0000 (10:32 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Wed, 12 Mar 2014 01:32:46 +0000 (10:32 +0900)
Solaris doesn't have struct ip_mreqn, instead it uses struct ip_mreq
and struct group_req with struct sockaddr_storage.

Also fixes incorrect SockaddrDatalink.

Update #7399

LGTM=aram, iant
R=golang-codereviews, aram, gobot, iant
CC=golang-codereviews
https://golang.org/cl/73920043

src/pkg/net/sockoptip_bsd.go
src/pkg/net/sockoptip_posix.go
src/pkg/net/sockoptip_stub.go [new file with mode: 0644]
src/pkg/syscall/syscall_solaris.go

index c6b339fa5a44d5015ec296b0b363b8ecac9626ee..87132f0f4610cc3ee9700d2896b48fdf40723c4c 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build darwin dragonfly freebsd nacl netbsd openbsd solaris
+// +build darwin dragonfly freebsd nacl netbsd openbsd
 
 package net
 
index 2aea6830b1c7296e6ba2680f6377c94374821c92..b5c80e4490996609c002c1e6de86325d007fa5af 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
+// +build darwin dragonfly freebsd linux nacl netbsd openbsd windows
 
 package net
 
diff --git a/src/pkg/net/sockoptip_stub.go b/src/pkg/net/sockoptip_stub.go
new file mode 100644 (file)
index 0000000..dcd3a22
--- /dev/null
@@ -0,0 +1,39 @@
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build solaris
+
+package net
+
+import "syscall"
+
+func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error {
+       // See golang.org/issue/7399.
+       return syscall.EINVAL
+}
+
+func setIPv4MulticastLoopback(fd *netFD, v bool) error {
+       // See golang.org/issue/7399.
+       return syscall.EINVAL
+}
+
+func joinIPv4Group(fd *netFD, ifi *Interface, ip IP) error {
+       // See golang.org/issue/7399.
+       return syscall.EINVAL
+}
+
+func setIPv6MulticastInterface(fd *netFD, ifi *Interface) error {
+       // See golang.org/issue/7399.
+       return syscall.EINVAL
+}
+
+func setIPv6MulticastLoopback(fd *netFD, v bool) error {
+       // See golang.org/issue/7399.
+       return syscall.EINVAL
+}
+
+func joinIPv6Group(fd *netFD, ifi *Interface, ip IP) error {
+       // See golang.org/issue/7399.
+       return syscall.EINVAL
+}
index 2e3f8bac2b0dcc95959b1ab77e5d4c5e72f3cff3..947874ee1f4b4ad51812dd306dd7e92849b45893 100644 (file)
@@ -15,14 +15,13 @@ package syscall
 import "unsafe"
 
 type SockaddrDatalink struct {
-       Len    uint8
-       Family uint8
+       Family uint16
        Index  uint16
        Type   uint8
        Nlen   uint8
        Alen   uint8
        Slen   uint8
-       Data   [46]int8
+       Data   [244]int8
        raw    RawSockaddrDatalink
 }
 
@@ -77,12 +76,6 @@ func Pipe(p []int) (err error) {
        return
 }
 
-type IPMreqn struct {
-       Multiaddr [4]byte /* in_addr */
-       Address   [4]byte /* in_addr */
-       Ifindex   int32
-}
-
 func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
        if sa.Port < 0 || sa.Port > 0xFFFF {
                return nil, 0, EINVAL
@@ -145,21 +138,6 @@ func Getsockname(fd int) (sa Sockaddr, err error) {
        return anyToSockaddr(&rsa)
 }
 
-func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) {
-       vallen := _Socklen(4)
-       err = getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen)
-       return value, err
-}
-
-func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {
-       // TODO(dfc)
-       return nil, EINVAL
-}
-
-func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
-       return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))
-}
-
 // The const provides a compile-time constant so clients
 // can adjust to whether there is a working Getwd and avoid
 // even linking this function into the binary.  See ../os/getwd.go.