diff --git a/client.go b/client.go index 2ab37862..28b77736 100644 --- a/client.go +++ b/client.go @@ -76,6 +76,8 @@ var ( DefaultReplyChan = newQueryChanSlice() // DefaultQueryChan is the channel were you can send the questions to. DefaultQueryChan = newQueryChan() + // Incoming is an alias for DefaultQueryChan + Incoming = DefaultReplyChan ) // The HandlerQueryFunc type is an adapter to allow the use of diff --git a/ex/q/q.go b/ex/q/q.go index c8b1bf30..d2ae37aa 100644 --- a/ex/q/q.go +++ b/ex/q/q.go @@ -169,7 +169,7 @@ Flags: // Add tsig if *tsig != "" { if algo, name, secret, ok := tsigKeyParse(*tsig); ok { - m.SetTsig(name, algo, 300, m.MsgHdr.Id, time.Now().Unix()) + m.SetTsig(name, algo, 300, time.Now().Unix()) c.TsigSecret = map[string]string{name: secret} } else { fmt.Fprintf(os.Stderr, "tsig key data error\n") @@ -183,7 +183,7 @@ Flags: forever: for { select { - case r := <-dns.DefaultReplyChan: + case r := <-dns.Incoming: if r.Reply != nil { if r.Reply.Rcode == dns.RcodeSuccess { if r.Request.Id != r.Reply.Id { diff --git a/ex/reflect/reflect.go b/ex/reflect/reflect.go index e84904e4..ba680493 100644 --- a/ex/reflect/reflect.go +++ b/ex/reflect/reflect.go @@ -88,7 +88,7 @@ func handleReflect(w dns.ResponseWriter, r *dns.Msg) { if r.IsTsig() { if w.TsigStatus() == nil { - m.SetTsig(r.Extra[len(r.Extra)-1].(*dns.RR_TSIG).Hdr.Name, dns.HmacMD5, 300, r.MsgHdr.Id, time.Now().Unix()) + m.SetTsig(r.Extra[len(r.Extra)-1].(*dns.RR_TSIG).Hdr.Name, dns.HmacMD5, 300, time.Now().Unix()) } else { println("Status", w.TsigStatus().Error()) } diff --git a/xfr.go b/xfr.go index 74101a07..3c012eaa 100644 --- a/xfr.go +++ b/xfr.go @@ -3,8 +3,8 @@ package dns // XfrReceives requests an incoming Ixfr or Axfr. If the message q's question // section has type TypeAXFR an Axfr is performed, if it is TypeIXFR it does an Ixfr. // The [AI]xfr's records are returned on the channel. Note that with an IXFR the client -// needs to determine if records are to be removed are added. -// The channel is closed when the transfer is terminated. +// needs to determine if records are to be removed or added. +// The returned channel is closed when the transfer is terminated. // // Basic use pattern for setting up a transfer: //