Commit 01f6e8cb authored by Yong Tang's avatar Yong Tang Committed by GitHub

Cleanup in go vet and misspell (#996)

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>
parent 1bb836b7
......@@ -118,7 +118,7 @@ func (f *Federation) Name() string { return "federation" }
// label is always the 2nd to last once the zone is chopped of. For instance
// "nginx.mynamespace.myfederation.svc.example.com" has "myfederation" as the federation label.
// IsNameFederation returns a new qname with the federation label and the label itself or two
// emtpy strings if there wasn't a hit.
// empty strings if there wasn't a hit.
func (f *Federation) isNameFederation(name, zone string) (string, string) {
base, _ := dnsutil.TrimZone(name, zone)
......
......@@ -74,7 +74,7 @@ func parseRequest(state request.Request) (r recordRequest, err error) {
return r, nil
}
// Becuase of ambiquity we check the labels left: 1: an endpoint. 2: port and protocol.
// Because of ambiquity we check the labels left: 1: an endpoint. 2: port and protocol.
// Anything else is a query that is too long to answer and can safely be delegated to return an nxdomain.
switch last {
......
......@@ -234,11 +234,11 @@ func (rule *edns0VariableRule) ruleData(w dns.ResponseWriter, r *dns.Msg) ([]byt
return []byte(req.Proto()), nil
case serverIP:
serverIp, _, err := net.SplitHostPort(w.LocalAddr().String())
ip, _, err := net.SplitHostPort(w.LocalAddr().String())
if err != nil {
serverIp = w.RemoteAddr().String()
ip = w.RemoteAddr().String()
}
return rule.ipToWire(rule.family(w.RemoteAddr()), serverIp)
return rule.ipToWire(rule.family(w.RemoteAddr()), ip)
case serverPort:
_, port, err := net.SplitHostPort(w.LocalAddr().String())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment