summaryrefslogtreecommitdiff
path: root/src/pkg/net/iprawsock.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/net/iprawsock.go')
-rw-r--r--src/pkg/net/iprawsock.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pkg/net/iprawsock.go b/src/pkg/net/iprawsock.go
index daccba366..9d99e7591 100644
--- a/src/pkg/net/iprawsock.go
+++ b/src/pkg/net/iprawsock.go
@@ -19,12 +19,15 @@ 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"