summaryrefslogtreecommitdiff
path: root/libgo/go/net/iprawsock.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2013-07-16 06:54:42 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2013-07-16 06:54:42 +0000
commitbe47d6eceffd2c5dbbc1566d5eea490527fb2bd4 (patch)
tree0e8fda573576bb4181dba29d0e88380a8c38fafd /libgo/go/net/iprawsock.go
parentefb30cdeb003fd7c585ee0d7657340086abcbd9e (diff)
libgo: Update to Go 1.1.1.
From-SVN: r200974
Diffstat (limited to 'libgo/go/net/iprawsock.go')
-rw-r--r--libgo/go/net/iprawsock.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/libgo/go/net/iprawsock.go b/libgo/go/net/iprawsock.go
index 13bfd62404a..0be94eb70eb 100644
--- a/libgo/go/net/iprawsock.go
+++ b/libgo/go/net/iprawsock.go
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Raw IP sockets
-
package net
// IPAddr represents the address of an IP end point.
@@ -19,17 +17,20 @@ func (a *IPAddr) String() string {
if a == nil {
return "<nil>"
}
+ if a.Zone != "" {
+ return a.IP.String() + "%" + a.Zone
+ }
return a.IP.String()
}
-// ResolveIPAddr parses addr as an IP address and resolves domain
-// names to numeric addresses on the network net, which must be
-// "ip", "ip4" or "ip6".
+// ResolveIPAddr parses addr as an IP address of the form "host" or
+// "ipv6-host%zone" and resolves the domain name on the network net,
+// which must be "ip", "ip4" or "ip6".
func ResolveIPAddr(net, addr string) (*IPAddr, error) {
if net == "" { // a hint wildcard for Go 1.0 undocumented behavior
net = "ip"
}
- afnet, _, err := parseDialNetwork(net)
+ afnet, _, err := parseNetwork(net)
if err != nil {
return nil, err
}