From 534433a714f1c38cedc5146ec19ead2d83de2d3b Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Wed, 20 Jun 2012 20:16:36 +0200 Subject: [PATCH] gofmt -w --- dns.go | 2 +- lookup.go | 8 ++------ msg.go | 10 +++++----- tsig.go | 2 +- xfr.go | 6 +++--- zscan_rr.go | 4 ++-- 6 files changed, 14 insertions(+), 18 deletions(-) diff --git a/dns.go b/dns.go index 5292c032..f8c1a0fc 100644 --- a/dns.go +++ b/dns.go @@ -106,7 +106,7 @@ type RR interface { // Len returns the length (in octects) of the uncompressed RR in wire format. Len() int // Copy returns a copy of the RR - Copy() RR + Copy() RR } // Exchange is used in (asynchronous) communication with the resolver. If the diff --git a/lookup.go b/lookup.go index f04f36c1..928ca862 100644 --- a/lookup.go +++ b/lookup.go @@ -30,7 +30,7 @@ func AssertDelegationSigner(m *Msg, trustdb []*RR_DNSKEY) error { var sig *RR_RRSIG for _, r := range m.Ns { if d, ok := r.(*RR_DS); ok { - dss = append(dss ,d) + dss = append(dss, d) continue } if s, ok := r.(*RR_RRSIG); ok { @@ -50,7 +50,6 @@ func AssertDelegationSigner(m *Msg, trustdb []*RR_DNSKEY) error { } println("SIG found") - // Ownername of the DSs should match the qname if CompareLabels(dss[0].Header().Name, m.Question[0].Name) == 0 { // No match @@ -60,12 +59,10 @@ func AssertDelegationSigner(m *Msg, trustdb []*RR_DNSKEY) error { println(dss[0].String()) println(sig.String()) - return nil } - // Types of answers (without looking the RFCs) // len(m.Ns) > 0 // NS records in there? -> delegation (rcode should be rcode.Success) @@ -74,7 +71,6 @@ func AssertDelegationSigner(m *Msg, trustdb []*RR_DNSKEY) error { // - plain old DNS delegation -> ... // SOA record in there? -> nxdomain (rcode should be rcode.Nxdomain) - // Lookup does a (secure) DNS lookup. The message m contains // the question to be asked. Lookup returns last packet seen // which is either the answer or a packet somewhere in the @@ -108,7 +104,7 @@ func Lookup(m *Msg) (*Msg, error) { // n is our reply, deal with it // Check for DS // Check for DS absent (NSEC/NSEC3) - if len(n.Ns) > 0 && len(n.Answer) == 0 && n.Rcode == RcodeSuccess { // Referral + if len(n.Ns) > 0 && len(n.Answer) == 0 && n.Rcode == RcodeSuccess { // Referral // the ns name of the nameservers should match the right most labels. Check the answer println("Referral") for i, j := range addrFromReferral4(n) { diff --git a/msg.go b/msg.go index f9f8c3c0..5cb8f274 100644 --- a/msg.go +++ b/msg.go @@ -92,16 +92,16 @@ type Msg struct { var Rr_str = map[uint16]string{ TypeCNAME: "CNAME", TypeHINFO: "HINFO", - TypeTLSA: "TSLA", + TypeTLSA: "TSLA", TypeMB: "MB", TypeMG: "MG", - TypeRP: "RP", - TypeMD: "MD", - TypeMF: "MF", + TypeRP: "RP", + TypeMD: "MD", + TypeMF: "MF", TypeMINFO: "MINFO", TypeMR: "MR", TypeMX: "MX", - TypeWKS: "WKS", + TypeWKS: "WKS", TypeNS: "NS", TypePTR: "PTR", TypeSOA: "SOA", diff --git a/tsig.go b/tsig.go index dee50bee..d28d4925 100644 --- a/tsig.go +++ b/tsig.go @@ -111,7 +111,7 @@ func (rr *RR_TSIG) Len() int { } func (rr *RR_TSIG) Copy() RR { - return &RR_TSIG{*rr.Hdr.CopyHeader(), rr.Algorithm, rr.TimeSigned, rr.Fudge, rr.MACSize, rr.MAC, rr.OrigId, rr.Error, rr.OtherLen, rr.OtherData} + return &RR_TSIG{*rr.Hdr.CopyHeader(), rr.Algorithm, rr.TimeSigned, rr.Fudge, rr.MACSize, rr.MAC, rr.OrigId, rr.Error, rr.OtherLen, rr.OtherData} } // The following values must be put in wireformat, so that the MAC can be calculated. diff --git a/xfr.go b/xfr.go index fe1e905d..27c3341b 100644 --- a/xfr.go +++ b/xfr.go @@ -90,13 +90,13 @@ func (w *reply) ixfrReceive(c chan *Exchange) { if first { // A single SOA RR signals "no changes" if len(in.Answer) == 1 && checkXfrSOA(in, true) { - c <- &Exchange{Request: w.req, Reply: in, Rtt: w.rtt, RemoteAddr: w.conn.RemoteAddr(), Error: nil} + c <- &Exchange{Request: w.req, Reply: in, Rtt: w.rtt, RemoteAddr: w.conn.RemoteAddr(), Error: nil} return } // Check if the returned answer is ok if !checkXfrSOA(in, true) { - c <- &Exchange{Request: w.req, Reply: in, Rtt: w.rtt, RemoteAddr: w.conn.RemoteAddr(), Error: ErrXfrSoa} + c <- &Exchange{Request: w.req, Reply: in, Rtt: w.rtt, RemoteAddr: w.conn.RemoteAddr(), Error: ErrXfrSoa} return } // This serial is important @@ -110,7 +110,7 @@ func (w *reply) ixfrReceive(c chan *Exchange) { // If the last record in the IXFR contains the servers' SOA, we should quit if v, ok := in.Answer[len(in.Answer)-1].(*RR_SOA); ok { if v.Serial == serial { - c <- &Exchange{Request: w.req, Reply: in, Rtt: w.rtt, RemoteAddr: w.conn.RemoteAddr(), Error: nil} + c <- &Exchange{Request: w.req, Reply: in, Rtt: w.rtt, RemoteAddr: w.conn.RemoteAddr(), Error: nil} return } } diff --git a/zscan_rr.go b/zscan_rr.go index 74ab5986..1ad8dc9c 100644 --- a/zscan_rr.go +++ b/zscan_rr.go @@ -1093,7 +1093,7 @@ func setWKS(h RR_Header, c chan lex, f string) (RR, *ParseError) { l = <-c rr.BitMap = make([]uint16, 0) var ( - k int + k int err error ) for l.value != _NEWLINE && l.value != _EOF { @@ -1102,7 +1102,7 @@ func setWKS(h RR_Header, c chan lex, f string) (RR, *ParseError) { // Ok case _STRING: if k, err = net.LookupPort(proto, l.token); err != nil { - if i, e := strconv.Atoi(l.token); e != nil { // If a number use that + if i, e := strconv.Atoi(l.token); e != nil { // If a number use that rr.BitMap = append(rr.BitMap, uint16(i)) } else { return nil, &ParseError{f, "bad WKS BitMap", l}