diff options
| author | David du Colombier <0intro@gmail.com> | 2013-12-16 12:00:23 -0800 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2013-12-16 12:00:23 -0800 |
| commit | 20dee338c322bb3beb805f837ab780f98cfe8d59 (patch) | |
| tree | 8aabc6b4e695637dc501af577aba96d1307480d5 /src/pkg | |
| parent | 4e23b693145790382bd8ed3f3e6634a5c527a9f6 (diff) | |
| download | go-20dee338c322bb3beb805f837ab780f98cfe8d59.tar.xz | |
net: lookup protocol in lower-case on Plan 9
Protocol keywords are case-insensitive,
but the Ndb database is case-sensitive.
Also use the generic net protocol instead
of tcp in lookupHost.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/40600047
Diffstat (limited to 'src/pkg')
| -rw-r--r-- | src/pkg/net/lookup_plan9.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pkg/net/lookup_plan9.go b/src/pkg/net/lookup_plan9.go index f1204a99f7..9874120851 100644 --- a/src/pkg/net/lookup_plan9.go +++ b/src/pkg/net/lookup_plan9.go @@ -7,6 +7,7 @@ package net import ( "errors" "os" + "strings" ) func query(filename, query string, bufSize int) (res []string, err error) { @@ -72,7 +73,7 @@ func queryDNS(addr string, typ string) (res []string, err error) { // lookupProtocol looks up IP protocol name and returns // the corresponding protocol number. func lookupProtocol(name string) (proto int, err error) { - lines, err := query("/net/cs", "!protocol="+name, 128) + lines, err := query("/net/cs", "!protocol="+strings.ToLower(name), 128) if err != nil { return 0, err } @@ -94,7 +95,7 @@ func lookupProtocol(name string) (proto int, err error) { func lookupHost(host string) (addrs []string, err error) { // Use /net/cs instead of /net/dns because cs knows about // host names in local network (e.g. from /lib/ndb/local) - lines, err := queryCS("tcp", host, "1") + lines, err := queryCS("net", host, "1") if err != nil { return } |
