summaryrefslogtreecommitdiff
path: root/libgo/go/net/iprawsock.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2018-09-24 21:46:21 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2018-09-24 21:46:21 +0000
commitdd931d9b48647e898dc80927c532ae93cc09e192 (patch)
tree71be2295cd79b8a182f6130611658db8628772d5 /libgo/go/net/iprawsock.go
parent779d8a5ad09b01428726ea5a0e6c87bd9ac3c0e4 (diff)
libgo: update to Go 1.11
Reviewed-on: https://go-review.googlesource.com/136435 gotools/: * Makefile.am (mostlyclean-local): Run chmod on check-go-dir to make sure it is writable. (check-go-tools): Likewise. (check-vet): Copy internal/objabi to check-vet-dir. * Makefile.in: Rebuild. From-SVN: r264546
Diffstat (limited to 'libgo/go/net/iprawsock.go')
-rw-r--r--libgo/go/net/iprawsock.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/libgo/go/net/iprawsock.go b/libgo/go/net/iprawsock.go
index 72cbc394337..8a9c26559bd 100644
--- a/libgo/go/net/iprawsock.go
+++ b/libgo/go/net/iprawsock.go
@@ -21,8 +21,8 @@ import (
// change the behavior of these methods; use Read or ReadMsgIP
// instead.
-// BUG(mikio): On NaCl and Plan 9, the ReadMsgIP and
-// WriteMsgIP methods of IPConn are not implemented.
+// BUG(mikio): On JS, NaCl and Plan 9, methods and functions related
+// to IPConn are not implemented.
// BUG(mikio): On Windows, the File method of IPConn is not
// implemented.
@@ -209,7 +209,11 @@ func newIPConn(fd *netFD) *IPConn { return &IPConn{conn{fd}} }
// If the IP field of raddr is nil or an unspecified IP address, the
// local system is assumed.
func DialIP(network string, laddr, raddr *IPAddr) (*IPConn, error) {
- c, err := dialIP(context.Background(), network, laddr, raddr)
+ if raddr == nil {
+ return nil, &OpError{Op: "dial", Net: network, Source: laddr.opAddr(), Addr: nil, Err: errMissingAddress}
+ }
+ sd := &sysDialer{network: network, address: raddr.String()}
+ c, err := sd.dialIP(context.Background(), laddr, raddr)
if err != nil {
return nil, &OpError{Op: "dial", Net: network, Source: laddr.opAddr(), Addr: raddr.opAddr(), Err: err}
}
@@ -224,7 +228,11 @@ func DialIP(network string, laddr, raddr *IPAddr) (*IPConn, error) {
// ListenIP listens on all available IP addresses of the local system
// except multicast IP addresses.
func ListenIP(network string, laddr *IPAddr) (*IPConn, error) {
- c, err := listenIP(context.Background(), network, laddr)
+ if laddr == nil {
+ laddr = &IPAddr{}
+ }
+ sl := &sysListener{network: network, address: laddr.String()}
+ c, err := sl.listenIP(context.Background(), laddr)
if err != nil {
return nil, &OpError{Op: "listen", Net: network, Source: nil, Addr: laddr.opAddr(), Err: err}
}