diff --git a/ex/axfr/axfr.go b/ex/axfr/axfr.go index efa8f203..6fa0a0af 100644 --- a/ex/axfr/axfr.go +++ b/ex/axfr/axfr.go @@ -1,7 +1,7 @@ package main import ( - "dns" + "github.com/miekg/dns" "flag" "fmt" "strings" diff --git a/ex/chaos/chaos.go b/ex/chaos/chaos.go index 96e1a03a..b85d6331 100644 --- a/ex/chaos/chaos.go +++ b/ex/chaos/chaos.go @@ -4,8 +4,8 @@ package main // address of NAMESERVER // (c) Miek Gieben - 2011 import ( - "dns" "fmt" + "github.com/miekg/dns" "os" ) diff --git a/ex/key2ds/key2ds.go b/ex/key2ds/key2ds.go index df365d70..b58d990b 100644 --- a/ex/key2ds/key2ds.go +++ b/ex/key2ds/key2ds.go @@ -5,8 +5,8 @@ package main // this directly from the internet. // (c) Miek Gieben - 2011 import ( - "dns" "fmt" + "github.com/miekg/dns" "os" ) diff --git a/ex/mx/mx.go b/ex/mx/mx.go index 4ad77887..cd4fab3d 100644 --- a/ex/mx/mx.go +++ b/ex/mx/mx.go @@ -3,8 +3,8 @@ package main // Print the MX records of a domain // (c) Miek Gieben - 2011 import ( - "dns" "fmt" + "github.com/miekg/dns" "os" ) diff --git a/ex/q/q.go b/ex/q/q.go index 9a56710d..89729c3f 100644 --- a/ex/q/q.go +++ b/ex/q/q.go @@ -1,9 +1,9 @@ package main import ( - "dns" "flag" "fmt" + "github.com/miekg/dns" "net" "os" "strconv" @@ -202,7 +202,7 @@ Flags: os.Exit(0) } }() - Redo: + Redo: if r == nil { return } diff --git a/ex/reflect/reflect.go b/ex/reflect/reflect.go index ac382595..b1d7182d 100644 --- a/ex/reflect/reflect.go +++ b/ex/reflect/reflect.go @@ -18,9 +18,9 @@ package main import ( - "dns" "flag" "fmt" + "github.com/miekg/dns" "log" "net" "os" @@ -107,7 +107,7 @@ func serve(net, name, secret string) { fmt.Printf("Failed to setup the "+net+" server: %s\n", err.Error()) } default: - server := &dns.Server{Addr: ":8053", Net: "net", TsigSecret: map[string]string{name: secret} } + server := &dns.Server{Addr: ":8053", Net: "net", TsigSecret: map[string]string{name: secret}} err := server.ListenAndServe() if err != nil { fmt.Printf("Failed to setup the "+net+" server: %s\n", err.Error()) diff --git a/msg.go b/msg.go index d3de39f1..c8ced0da 100644 --- a/msg.go +++ b/msg.go @@ -1066,7 +1066,7 @@ func PackRR(rr RR, msg []byte, off int, compression map[string]int, compress boo if !ok { return len(msg), false } - RawSetRdlength(msg, off, off1) + rawSetRdlength(msg, off, off1) return off1, true } diff --git a/rawmsg.go b/rawmsg.go index 16f2edd8..f7a4a8d3 100644 --- a/rawmsg.go +++ b/rawmsg.go @@ -12,31 +12,31 @@ func RawSetId(msg []byte, i uint16) { msg[0], msg[1] = packUint16(i) } -// RawSetQuestionLen sets the lenght of the question section. -func RawSetQuestionLen(msg []byte, i uint16) { +// rawSetQuestionLen sets the lenght of the question section. +func rawSetQuestionLen(msg []byte, i uint16) { msg[4], msg[5] = packUint16(i) } -// RawSetAnswerLen sets the lenght of the answer section. -func RawSetAnswerLen(msg []byte, i uint16) { +// rawSetAnswerLen sets the lenght of the answer section. +func rawSetAnswerLen(msg []byte, i uint16) { msg[6], msg[7] = packUint16(i) } -// RawSetsNsLen sets the lenght of the authority section. -func RawSetNsLen(msg []byte, i uint16) { +// rawSetsNsLen sets the lenght of the authority section. +func rawSetNsLen(msg []byte, i uint16) { msg[8], msg[9] = packUint16(i) } -// RawSetExtraLen sets the lenght of the additional section. -func RawSetExtraLen(msg []byte, i uint16) { +// rawSetExtraLen sets the lenght of the additional section. +func rawSetExtraLen(msg []byte, i uint16) { msg[10], msg[11] = packUint16(i) } -// RawSetRdlength sets the rdlength in the header of +// rawSetRdlength sets the rdlength in the header of // the RR. The offset 'off' must be positioned at the // start of the header of the RR, 'end' must be the // end of the RR. There is no check if we overrun the buffer. -func RawSetRdlength(msg []byte, off, end int) { +func rawSetRdlength(msg []byte, off, end int) { Loop: for { c := int(msg[off]) diff --git a/tsig.go b/tsig.go index be63ac5a..6ce2a1b6 100644 --- a/tsig.go +++ b/tsig.go @@ -200,7 +200,7 @@ func TsigGenerate(m *Msg, secret, requestMAC string, timersOnly bool) ([]byte, s return nil, "", ErrPack } mbuf = append(mbuf, tbuf...) - RawSetExtraLen(mbuf, uint16(len(m.Extra)+1)) + rawSetExtraLen(mbuf, uint16(len(m.Extra)+1)) return mbuf, t.MAC, nil }