Quite a lot of dependency updates

This commit is contained in:
Frank Denis 2020-03-13 17:58:44 +01:00
parent 19647e03a6
commit 26ebb55c8c
61 changed files with 13152 additions and 90698 deletions

6
go.mod
View file

@ -22,9 +22,9 @@ require (
github.com/kardianos/service v1.0.1-0.20191211031725-3c356ae54c8a github.com/kardianos/service v1.0.1-0.20191211031725-3c356ae54c8a
github.com/miekg/dns v1.1.28 github.com/miekg/dns v1.1.28
github.com/powerman/check v1.2.1 github.com/powerman/check v1.2.1
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b golang.org/x/net v0.0.0-20200301022130-244492dfa37a
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527
golang.org/x/text v0.3.2 // indirect golang.org/x/text v0.3.2 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/yaml.v2 v2.2.7 // indirect gopkg.in/yaml.v2 v2.2.7 // indirect

14
go.sum
View file

@ -48,8 +48,6 @@ github.com/k-sone/critbitgo v1.4.0 h1:l71cTyBGeh6X5ATh6Fibgw3+rtNT80BA0uNNWgkPrb
github.com/k-sone/critbitgo v1.4.0/go.mod h1:7E6pyoyADnFxlUBEKcnfS49b7SUAQGMK+OAp/UQvo0s= github.com/k-sone/critbitgo v1.4.0/go.mod h1:7E6pyoyADnFxlUBEKcnfS49b7SUAQGMK+OAp/UQvo0s=
github.com/kardianos/service v1.0.1-0.20191211031725-3c356ae54c8a h1:T/nL7taPRFDwzB7c31FQTuykulaA11ERY3K6NcoQ/Bg= github.com/kardianos/service v1.0.1-0.20191211031725-3c356ae54c8a h1:T/nL7taPRFDwzB7c31FQTuykulaA11ERY3K6NcoQ/Bg=
github.com/kardianos/service v1.0.1-0.20191211031725-3c356ae54c8a/go.mod h1:8CzDhVuCuugtsHyZoTvsOBuvonN/UDBvl0kH+BUxvbo= github.com/kardianos/service v1.0.1-0.20191211031725-3c356ae54c8a/go.mod h1:8CzDhVuCuugtsHyZoTvsOBuvonN/UDBvl0kH+BUxvbo=
github.com/miekg/dns v1.1.27 h1:aEH/kqUzUxGJ/UHcEKdJY+ugH6WEzsEBBSPa8zuy1aM=
github.com/miekg/dns v1.1.27/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/miekg/dns v1.1.28 h1:gQhy5bsJa8zTlVI8lywCTZp1lguor+xevFoYlzeCTQY= github.com/miekg/dns v1.1.28 h1:gQhy5bsJa8zTlVI8lywCTZp1lguor+xevFoYlzeCTQY=
github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
@ -66,15 +64,15 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d h1:1ZiEyfaQIg3Qh0EoqpwAakHVhecoE5wlSg5GjnafJGw= golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4 h1:QmwruyY+bKbDDL0BaglrbZABEali68eoMFhTZpCjYVA=
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@ -84,8 +82,8 @@ golang.org/x/sys v0.0.0-20190529164535-6a60838ec259/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190909082730-f460065e899a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190909082730-f460065e899a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191029155521-f43be2a4598c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191029155521-f43be2a4598c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=

View file

@ -105,7 +105,7 @@ func (dns *Msg) SetAxfr(z string) *Msg {
// SetTsig appends a TSIG RR to the message. // SetTsig appends a TSIG RR to the message.
// This is only a skeleton TSIG RR that is added as the last RR in the // This is only a skeleton TSIG RR that is added as the last RR in the
// additional section. The Tsig is calculated when the message is being send. // additional section. The TSIG is calculated when the message is being send.
func (dns *Msg) SetTsig(z, algo string, fudge uint16, timesigned int64) *Msg { func (dns *Msg) SetTsig(z, algo string, fudge uint16, timesigned int64) *Msg {
t := new(TSIG) t := new(TSIG)
t.Hdr = RR_Header{z, TypeTSIG, ClassANY, 0, 0} t.Hdr = RR_Header{z, TypeTSIG, ClassANY, 0, 0}
@ -364,7 +364,7 @@ func (t Type) String() string {
// String returns the string representation for the class c. // String returns the string representation for the class c.
func (c Class) String() string { func (c Class) String() string {
if s, ok := ClassToString[uint16(c)]; ok { if s, ok := ClassToString[uint16(c)]; ok {
// Only emit mnemonics when they are unambiguous, specically ANY is in both. // Only emit mnemonics when they are unambiguous, specially ANY is in both.
if _, ok := StringToType[s]; !ok { if _, ok := StringToType[s]; !ok {
return s return s
} }

2
vendor/github.com/miekg/dns/doc.go generated vendored
View file

@ -209,7 +209,7 @@ Basic use pattern validating and replying to a message that has TSIG set.
// *Msg r has an TSIG record and it was validated // *Msg r has an TSIG record and it was validated
m.SetTsig("axfr.", dns.HmacMD5, 300, time.Now().Unix()) m.SetTsig("axfr.", dns.HmacMD5, 300, time.Now().Unix())
} else { } else {
// *Msg r has an TSIG records and it was not valided // *Msg r has an TSIG records and it was not validated
} }
} }
w.WriteMsg(m) w.WriteMsg(m)

View file

@ -3,9 +3,8 @@ package dns
//go:generate go run duplicate_generate.go //go:generate go run duplicate_generate.go
// IsDuplicate checks of r1 and r2 are duplicates of each other, excluding the TTL. // IsDuplicate checks of r1 and r2 are duplicates of each other, excluding the TTL.
// So this means the header data is equal *and* the RDATA is the same. Return true // So this means the header data is equal *and* the RDATA is the same. Returns true
// is so, otherwise false. // if so, otherwise false. It's a protocol violation to have identical RRs in a message.
// It's a protocol violation to have identical RRs in a message.
func IsDuplicate(r1, r2 RR) bool { func IsDuplicate(r1, r2 RR) bool {
// Check whether the record header is identical. // Check whether the record header is identical.
if !r1.Header().isDuplicate(r2.Header()) { if !r1.Header().isDuplicate(r2.Header()) {

View file

@ -83,7 +83,7 @@ func CompareDomainName(s1, s2 string) (n int) {
return return
} }
// CountLabel counts the the number of labels in the string s. // CountLabel counts the number of labels in the string s.
// s must be a syntactically valid domain name. // s must be a syntactically valid domain name.
func CountLabel(s string) (labels int) { func CountLabel(s string) (labels int) {
if s == "." { if s == "." {

1
vendor/github.com/miekg/dns/msg.go generated vendored
View file

@ -661,7 +661,6 @@ func unpackRRslice(l int, msg []byte, off int) (dst1 []RR, off1 int, err error)
} }
// If offset does not increase anymore, l is a lie // If offset does not increase anymore, l is a lie
if off1 == off { if off1 == off {
l = i
break break
} }
dst = append(dst, r) dst = append(dst, r)

View file

@ -73,7 +73,7 @@ func (dns *Msg) Truncate(size int) {
var numExtra int var numExtra int
if l < size { if l < size {
l, numExtra = truncateLoop(dns.Extra, size, l, compression) _, numExtra = truncateLoop(dns.Extra, size, l, compression)
} }
// See the function documentation for when we set this. // See the function documentation for when we set this.

View file

@ -43,7 +43,7 @@ func HashName(label string, ha uint8, iter uint16, salt string) string {
return toBase32(nsec3) return toBase32(nsec3)
} }
// Cover returns true if a name is covered by the NSEC3 record // Cover returns true if a name is covered by the NSEC3 record.
func (rr *NSEC3) Cover(name string) bool { func (rr *NSEC3) Cover(name string) bool {
nameHash := HashName(name, rr.Hash, rr.Iterations, rr.Salt) nameHash := HashName(name, rr.Hash, rr.Iterations, rr.Salt)
owner := strings.ToUpper(rr.Hdr.Name) owner := strings.ToUpper(rr.Hdr.Name)

View file

@ -13,7 +13,6 @@ type PrivateRdata interface {
// Pack is used when packing a private RR into a buffer. // Pack is used when packing a private RR into a buffer.
Pack([]byte) (int, error) Pack([]byte) (int, error)
// Unpack is used when unpacking a private RR from a buffer. // Unpack is used when unpacking a private RR from a buffer.
// TODO(miek): diff. signature than Pack, see edns0.go for instance.
Unpack([]byte) (int, error) Unpack([]byte) (int, error)
// Copy copies the Rdata into the PrivateRdata argument. // Copy copies the Rdata into the PrivateRdata argument.
Copy(PrivateRdata) error Copy(PrivateRdata) error

13
vendor/github.com/miekg/dns/scan.go generated vendored
View file

@ -103,15 +103,12 @@ type ttlState struct {
isByDirective bool // isByDirective indicates whether ttl was set by a $TTL directive isByDirective bool // isByDirective indicates whether ttl was set by a $TTL directive
} }
// NewRR reads the RR contained in the string s. Only the first RR is // NewRR reads the RR contained in the string s. Only the first RR is returned.
// returned. If s contains no records, NewRR will return nil with no // If s contains no records, NewRR will return nil with no error.
// error.
// //
// The class defaults to IN and TTL defaults to 3600. The full zone // The class defaults to IN and TTL defaults to 3600. The full zone file syntax
// file syntax like $TTL, $ORIGIN, etc. is supported. // like $TTL, $ORIGIN, etc. is supported. All fields of the returned RR are
// // set, except RR.Header().Rdlength which is set to 0.
// All fields of the returned RR are set, except RR.Header().Rdlength
// which is set to 0.
func NewRR(s string) (RR, error) { func NewRR(s string) (RR, error) {
if len(s) > 0 && s[len(s)-1] != '\n' { // We need a closing newline if len(s) > 0 && s[len(s)-1] != '\n' { // We need a closing newline
return ReadRR(strings.NewReader(s+"\n"), "") return ReadRR(strings.NewReader(s+"\n"), "")

View file

@ -403,7 +403,7 @@ func (rr *SOA) parse(c *zlexer, o string) *ParseError {
if l.err { if l.err {
return &ParseError{"", "bad SOA zone parameter", l} return &ParseError{"", "bad SOA zone parameter", l}
} }
if j, e := strconv.ParseUint(l.token, 10, 32); e != nil { if j, err := strconv.ParseUint(l.token, 10, 32); err != nil {
if i == 0 { if i == 0 {
// Serial must be a number // Serial must be a number
return &ParseError{"", "bad SOA zone parameter", l} return &ParseError{"", "bad SOA zone parameter", l}
@ -446,16 +446,16 @@ func (rr *SRV) parse(c *zlexer, o string) *ParseError {
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() // zString l, _ = c.Next() // zString
i, e = strconv.ParseUint(l.token, 10, 16) i, e1 := strconv.ParseUint(l.token, 10, 16)
if e != nil || l.err { if e1 != nil || l.err {
return &ParseError{"", "bad SRV Weight", l} return &ParseError{"", "bad SRV Weight", l}
} }
rr.Weight = uint16(i) rr.Weight = uint16(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() // zString l, _ = c.Next() // zString
i, e = strconv.ParseUint(l.token, 10, 16) i, e2 := strconv.ParseUint(l.token, 10, 16)
if e != nil || l.err { if e2 != nil || l.err {
return &ParseError{"", "bad SRV Port", l} return &ParseError{"", "bad SRV Port", l}
} }
rr.Port = uint16(i) rr.Port = uint16(i)
@ -482,8 +482,8 @@ func (rr *NAPTR) parse(c *zlexer, o string) *ParseError {
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() // zString l, _ = c.Next() // zString
i, e = strconv.ParseUint(l.token, 10, 16) i, e1 := strconv.ParseUint(l.token, 10, 16)
if e != nil || l.err { if e1 != nil || l.err {
return &ParseError{"", "bad NAPTR Preference", l} return &ParseError{"", "bad NAPTR Preference", l}
} }
rr.Preference = uint16(i) rr.Preference = uint16(i)
@ -581,9 +581,9 @@ func (rr *TALINK) parse(c *zlexer, o string) *ParseError {
func (rr *LOC) parse(c *zlexer, o string) *ParseError { func (rr *LOC) parse(c *zlexer, o string) *ParseError {
// Non zero defaults for LOC record, see RFC 1876, Section 3. // Non zero defaults for LOC record, see RFC 1876, Section 3.
rr.HorizPre = 165 // 10000 rr.Size = 0x12 // 1e2 cm (1m)
rr.VertPre = 162 // 10 rr.HorizPre = 0x16 // 1e6 cm (10000m)
rr.Size = 18 // 1 rr.VertPre = 0x13 // 1e3 cm (10m)
ok := false ok := false
// North // North
@ -600,15 +600,15 @@ func (rr *LOC) parse(c *zlexer, o string) *ParseError {
if rr.Latitude, ok = locCheckNorth(l.token, rr.Latitude); ok { if rr.Latitude, ok = locCheckNorth(l.token, rr.Latitude); ok {
goto East goto East
} }
i, e = strconv.ParseUint(l.token, 10, 32) if i, err := strconv.ParseUint(l.token, 10, 32); err != nil || l.err {
if e != nil || l.err {
return &ParseError{"", "bad LOC Latitude minutes", l} return &ParseError{"", "bad LOC Latitude minutes", l}
} } else {
rr.Latitude += 1000 * 60 * uint32(i) rr.Latitude += 1000 * 60 * uint32(i)
}
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
if i, e := strconv.ParseFloat(l.token, 32); e != nil || l.err { if i, err := strconv.ParseFloat(l.token, 32); err != nil || l.err {
return &ParseError{"", "bad LOC Latitude seconds", l} return &ParseError{"", "bad LOC Latitude seconds", l}
} else { } else {
rr.Latitude += uint32(1000 * i) rr.Latitude += uint32(1000 * i)
@ -626,7 +626,7 @@ East:
// East // East
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
if i, e := strconv.ParseUint(l.token, 10, 32); e != nil || l.err { if i, err := strconv.ParseUint(l.token, 10, 32); err != nil || l.err {
return &ParseError{"", "bad LOC Longitude", l} return &ParseError{"", "bad LOC Longitude", l}
} else { } else {
rr.Longitude = 1000 * 60 * 60 * uint32(i) rr.Longitude = 1000 * 60 * 60 * uint32(i)
@ -637,14 +637,14 @@ East:
if rr.Longitude, ok = locCheckEast(l.token, rr.Longitude); ok { if rr.Longitude, ok = locCheckEast(l.token, rr.Longitude); ok {
goto Altitude goto Altitude
} }
if i, e := strconv.ParseUint(l.token, 10, 32); e != nil || l.err { if i, err := strconv.ParseUint(l.token, 10, 32); err != nil || l.err {
return &ParseError{"", "bad LOC Longitude minutes", l} return &ParseError{"", "bad LOC Longitude minutes", l}
} else { } else {
rr.Longitude += 1000 * 60 * uint32(i) rr.Longitude += 1000 * 60 * uint32(i)
} }
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
if i, e := strconv.ParseFloat(l.token, 32); e != nil || l.err { if i, err := strconv.ParseFloat(l.token, 32); err != nil || l.err {
return &ParseError{"", "bad LOC Longitude seconds", l} return &ParseError{"", "bad LOC Longitude seconds", l}
} else { } else {
rr.Longitude += uint32(1000 * i) rr.Longitude += uint32(1000 * i)
@ -667,7 +667,7 @@ Altitude:
if l.token[len(l.token)-1] == 'M' || l.token[len(l.token)-1] == 'm' { if l.token[len(l.token)-1] == 'M' || l.token[len(l.token)-1] == 'm' {
l.token = l.token[0 : len(l.token)-1] l.token = l.token[0 : len(l.token)-1]
} }
if i, e := strconv.ParseFloat(l.token, 32); e != nil { if i, err := strconv.ParseFloat(l.token, 32); err != nil {
return &ParseError{"", "bad LOC Altitude", l} return &ParseError{"", "bad LOC Altitude", l}
} else { } else {
rr.Altitude = uint32(i*100.0 + 10000000.0 + 0.5) rr.Altitude = uint32(i*100.0 + 10000000.0 + 0.5)
@ -681,23 +681,23 @@ Altitude:
case zString: case zString:
switch count { switch count {
case 0: // Size case 0: // Size
e, m, ok := stringToCm(l.token) exp, m, ok := stringToCm(l.token)
if !ok { if !ok {
return &ParseError{"", "bad LOC Size", l} return &ParseError{"", "bad LOC Size", l}
} }
rr.Size = e&0x0f | m<<4&0xf0 rr.Size = exp&0x0f | m<<4&0xf0
case 1: // HorizPre case 1: // HorizPre
e, m, ok := stringToCm(l.token) exp, m, ok := stringToCm(l.token)
if !ok { if !ok {
return &ParseError{"", "bad LOC HorizPre", l} return &ParseError{"", "bad LOC HorizPre", l}
} }
rr.HorizPre = e&0x0f | m<<4&0xf0 rr.HorizPre = exp&0x0f | m<<4&0xf0
case 2: // VertPre case 2: // VertPre
e, m, ok := stringToCm(l.token) exp, m, ok := stringToCm(l.token)
if !ok { if !ok {
return &ParseError{"", "bad LOC VertPre", l} return &ParseError{"", "bad LOC VertPre", l}
} }
rr.VertPre = e&0x0f | m<<4&0xf0 rr.VertPre = exp&0x0f | m<<4&0xf0
} }
count++ count++
case zBlank: case zBlank:
@ -762,7 +762,7 @@ func (rr *CERT) parse(c *zlexer, o string) *ParseError {
l, _ := c.Next() l, _ := c.Next()
if v, ok := StringToCertType[l.token]; ok { if v, ok := StringToCertType[l.token]; ok {
rr.Type = v rr.Type = v
} else if i, e := strconv.ParseUint(l.token, 10, 16); e != nil { } else if i, err := strconv.ParseUint(l.token, 10, 16); err != nil {
return &ParseError{"", "bad CERT Type", l} return &ParseError{"", "bad CERT Type", l}
} else { } else {
rr.Type = uint16(i) rr.Type = uint16(i)
@ -778,7 +778,7 @@ func (rr *CERT) parse(c *zlexer, o string) *ParseError {
l, _ = c.Next() // zString l, _ = c.Next() // zString
if v, ok := StringToAlgorithm[l.token]; ok { if v, ok := StringToAlgorithm[l.token]; ok {
rr.Algorithm = v rr.Algorithm = v
} else if i, e := strconv.ParseUint(l.token, 10, 8); e != nil { } else if i, err := strconv.ParseUint(l.token, 10, 8); err != nil {
return &ParseError{"", "bad CERT Algorithm", l} return &ParseError{"", "bad CERT Algorithm", l}
} else { } else {
rr.Algorithm = uint8(i) rr.Algorithm = uint8(i)
@ -812,8 +812,8 @@ func (rr *CSYNC) parse(c *zlexer, o string) *ParseError {
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
j, e = strconv.ParseUint(l.token, 10, 16) j, e1 := strconv.ParseUint(l.token, 10, 16)
if e != nil { if e1 != nil {
// Serial must be a number // Serial must be a number
return &ParseError{"", "bad CSYNC flags", l} return &ParseError{"", "bad CSYNC flags", l}
} }
@ -845,9 +845,7 @@ func (rr *CSYNC) parse(c *zlexer, o string) *ParseError {
return nil return nil
} }
func (rr *SIG) parse(c *zlexer, o string) *ParseError { func (rr *SIG) parse(c *zlexer, o string) *ParseError { return rr.RRSIG.parse(c, o) }
return rr.RRSIG.parse(c, o)
}
func (rr *RRSIG) parse(c *zlexer, o string) *ParseError { func (rr *RRSIG) parse(c *zlexer, o string) *ParseError {
l, _ := c.Next() l, _ := c.Next()
@ -868,24 +866,24 @@ func (rr *RRSIG) parse(c *zlexer, o string) *ParseError {
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
i, err := strconv.ParseUint(l.token, 10, 8) i, e := strconv.ParseUint(l.token, 10, 8)
if err != nil || l.err { if e != nil || l.err {
return &ParseError{"", "bad RRSIG Algorithm", l} return &ParseError{"", "bad RRSIG Algorithm", l}
} }
rr.Algorithm = uint8(i) rr.Algorithm = uint8(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
i, err = strconv.ParseUint(l.token, 10, 8) i, e1 := strconv.ParseUint(l.token, 10, 8)
if err != nil || l.err { if e1 != nil || l.err {
return &ParseError{"", "bad RRSIG Labels", l} return &ParseError{"", "bad RRSIG Labels", l}
} }
rr.Labels = uint8(i) rr.Labels = uint8(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
i, err = strconv.ParseUint(l.token, 10, 32) i, e2 := strconv.ParseUint(l.token, 10, 32)
if err != nil || l.err { if e2 != nil || l.err {
return &ParseError{"", "bad RRSIG OrigTtl", l} return &ParseError{"", "bad RRSIG OrigTtl", l}
} }
rr.OrigTtl = uint32(i) rr.OrigTtl = uint32(i)
@ -918,8 +916,8 @@ func (rr *RRSIG) parse(c *zlexer, o string) *ParseError {
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
i, err = strconv.ParseUint(l.token, 10, 16) i, e3 := strconv.ParseUint(l.token, 10, 16)
if err != nil || l.err { if e3 != nil || l.err {
return &ParseError{"", "bad RRSIG KeyTag", l} return &ParseError{"", "bad RRSIG KeyTag", l}
} }
rr.KeyTag = uint16(i) rr.KeyTag = uint16(i)
@ -933,9 +931,9 @@ func (rr *RRSIG) parse(c *zlexer, o string) *ParseError {
} }
rr.SignerName = name rr.SignerName = name
s, e := endingToString(c, "bad RRSIG Signature") s, e4 := endingToString(c, "bad RRSIG Signature")
if e != nil { if e4 != nil {
return e return e4
} }
rr.Signature = s rr.Signature = s
@ -985,15 +983,15 @@ func (rr *NSEC3) parse(c *zlexer, o string) *ParseError {
rr.Hash = uint8(i) rr.Hash = uint8(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
i, e = strconv.ParseUint(l.token, 10, 8) i, e1 := strconv.ParseUint(l.token, 10, 8)
if e != nil || l.err { if e1 != nil || l.err {
return &ParseError{"", "bad NSEC3 Flags", l} return &ParseError{"", "bad NSEC3 Flags", l}
} }
rr.Flags = uint8(i) rr.Flags = uint8(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
i, e = strconv.ParseUint(l.token, 10, 16) i, e2 := strconv.ParseUint(l.token, 10, 16)
if e != nil || l.err { if e2 != nil || l.err {
return &ParseError{"", "bad NSEC3 Iterations", l} return &ParseError{"", "bad NSEC3 Iterations", l}
} }
rr.Iterations = uint16(i) rr.Iterations = uint16(i)
@ -1050,22 +1048,22 @@ func (rr *NSEC3PARAM) parse(c *zlexer, o string) *ParseError {
rr.Hash = uint8(i) rr.Hash = uint8(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
i, e = strconv.ParseUint(l.token, 10, 8) i, e1 := strconv.ParseUint(l.token, 10, 8)
if e != nil || l.err { if e1 != nil || l.err {
return &ParseError{"", "bad NSEC3PARAM Flags", l} return &ParseError{"", "bad NSEC3PARAM Flags", l}
} }
rr.Flags = uint8(i) rr.Flags = uint8(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
i, e = strconv.ParseUint(l.token, 10, 16) i, e2 := strconv.ParseUint(l.token, 10, 16)
if e != nil || l.err { if e2 != nil || l.err {
return &ParseError{"", "bad NSEC3PARAM Iterations", l} return &ParseError{"", "bad NSEC3PARAM Iterations", l}
} }
rr.Iterations = uint16(i) rr.Iterations = uint16(i)
c.Next() c.Next()
l, _ = c.Next() l, _ = c.Next()
if l.token != "-" { if l.token != "-" {
rr.SaltLength = uint8(len(l.token)) rr.SaltLength = uint8(len(l.token) / 2)
rr.Salt = l.token rr.Salt = l.token
} }
return slurpRemainder(c) return slurpRemainder(c)
@ -1132,15 +1130,15 @@ func (rr *SSHFP) parse(c *zlexer, o string) *ParseError {
rr.Algorithm = uint8(i) rr.Algorithm = uint8(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
i, e = strconv.ParseUint(l.token, 10, 8) i, e1 := strconv.ParseUint(l.token, 10, 8)
if e != nil || l.err { if e1 != nil || l.err {
return &ParseError{"", "bad SSHFP Type", l} return &ParseError{"", "bad SSHFP Type", l}
} }
rr.Type = uint8(i) rr.Type = uint8(i)
c.Next() // zBlank c.Next() // zBlank
s, e1 := endingToString(c, "bad SSHFP Fingerprint") s, e2 := endingToString(c, "bad SSHFP Fingerprint")
if e1 != nil { if e2 != nil {
return e1 return e2
} }
rr.FingerPrint = s rr.FingerPrint = s
return nil return nil
@ -1155,37 +1153,32 @@ func (rr *DNSKEY) parseDNSKEY(c *zlexer, o, typ string) *ParseError {
rr.Flags = uint16(i) rr.Flags = uint16(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() // zString l, _ = c.Next() // zString
i, e = strconv.ParseUint(l.token, 10, 8) i, e1 := strconv.ParseUint(l.token, 10, 8)
if e != nil || l.err { if e1 != nil || l.err {
return &ParseError{"", "bad " + typ + " Protocol", l} return &ParseError{"", "bad " + typ + " Protocol", l}
} }
rr.Protocol = uint8(i) rr.Protocol = uint8(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() // zString l, _ = c.Next() // zString
i, e = strconv.ParseUint(l.token, 10, 8) i, e2 := strconv.ParseUint(l.token, 10, 8)
if e != nil || l.err { if e2 != nil || l.err {
return &ParseError{"", "bad " + typ + " Algorithm", l} return &ParseError{"", "bad " + typ + " Algorithm", l}
} }
rr.Algorithm = uint8(i) rr.Algorithm = uint8(i)
s, e1 := endingToString(c, "bad "+typ+" PublicKey") s, e3 := endingToString(c, "bad "+typ+" PublicKey")
if e1 != nil { if e3 != nil {
return e1 return e3
} }
rr.PublicKey = s rr.PublicKey = s
return nil return nil
} }
func (rr *DNSKEY) parse(c *zlexer, o string) *ParseError { func (rr *DNSKEY) parse(c *zlexer, o string) *ParseError { return rr.parseDNSKEY(c, o, "DNSKEY") }
return rr.parseDNSKEY(c, o, "DNSKEY") func (rr *KEY) parse(c *zlexer, o string) *ParseError { return rr.parseDNSKEY(c, o, "KEY") }
} func (rr *CDNSKEY) parse(c *zlexer, o string) *ParseError { return rr.parseDNSKEY(c, o, "CDNSKEY") }
func (rr *DS) parse(c *zlexer, o string) *ParseError { return rr.parseDS(c, o, "DS") }
func (rr *KEY) parse(c *zlexer, o string) *ParseError { func (rr *DLV) parse(c *zlexer, o string) *ParseError { return rr.parseDS(c, o, "DLV") }
return rr.parseDNSKEY(c, o, "KEY") func (rr *CDS) parse(c *zlexer, o string) *ParseError { return rr.parseDS(c, o, "CDS") }
}
func (rr *CDNSKEY) parse(c *zlexer, o string) *ParseError {
return rr.parseDNSKEY(c, o, "CDNSKEY")
}
func (rr *RKEY) parse(c *zlexer, o string) *ParseError { func (rr *RKEY) parse(c *zlexer, o string) *ParseError {
l, _ := c.Next() l, _ := c.Next()
@ -1196,21 +1189,21 @@ func (rr *RKEY) parse(c *zlexer, o string) *ParseError {
rr.Flags = uint16(i) rr.Flags = uint16(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() // zString l, _ = c.Next() // zString
i, e = strconv.ParseUint(l.token, 10, 8) i, e1 := strconv.ParseUint(l.token, 10, 8)
if e != nil || l.err { if e1 != nil || l.err {
return &ParseError{"", "bad RKEY Protocol", l} return &ParseError{"", "bad RKEY Protocol", l}
} }
rr.Protocol = uint8(i) rr.Protocol = uint8(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() // zString l, _ = c.Next() // zString
i, e = strconv.ParseUint(l.token, 10, 8) i, e2 := strconv.ParseUint(l.token, 10, 8)
if e != nil || l.err { if e2 != nil || l.err {
return &ParseError{"", "bad RKEY Algorithm", l} return &ParseError{"", "bad RKEY Algorithm", l}
} }
rr.Algorithm = uint8(i) rr.Algorithm = uint8(i)
s, e1 := endingToString(c, "bad RKEY PublicKey") s, e3 := endingToString(c, "bad RKEY PublicKey")
if e1 != nil { if e3 != nil {
return e1 return e3
} }
rr.PublicKey = s rr.PublicKey = s
return nil return nil
@ -1243,15 +1236,15 @@ func (rr *GPOS) parse(c *zlexer, o string) *ParseError {
rr.Longitude = l.token rr.Longitude = l.token
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
_, e = strconv.ParseFloat(l.token, 64) _, e1 := strconv.ParseFloat(l.token, 64)
if e != nil || l.err { if e1 != nil || l.err {
return &ParseError{"", "bad GPOS Latitude", l} return &ParseError{"", "bad GPOS Latitude", l}
} }
rr.Latitude = l.token rr.Latitude = l.token
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
_, e = strconv.ParseFloat(l.token, 64) _, e2 := strconv.ParseFloat(l.token, 64)
if e != nil || l.err { if e2 != nil || l.err {
return &ParseError{"", "bad GPOS Altitude", l} return &ParseError{"", "bad GPOS Altitude", l}
} }
rr.Altitude = l.token rr.Altitude = l.token
@ -1267,7 +1260,7 @@ func (rr *DS) parseDS(c *zlexer, o, typ string) *ParseError {
rr.KeyTag = uint16(i) rr.KeyTag = uint16(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
if i, e = strconv.ParseUint(l.token, 10, 8); e != nil { if i, err := strconv.ParseUint(l.token, 10, 8); err != nil {
tokenUpper := strings.ToUpper(l.token) tokenUpper := strings.ToUpper(l.token)
i, ok := StringToAlgorithm[tokenUpper] i, ok := StringToAlgorithm[tokenUpper]
if !ok || l.err { if !ok || l.err {
@ -1279,31 +1272,19 @@ func (rr *DS) parseDS(c *zlexer, o, typ string) *ParseError {
} }
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
i, e = strconv.ParseUint(l.token, 10, 8) i, e1 := strconv.ParseUint(l.token, 10, 8)
if e != nil || l.err { if e1 != nil || l.err {
return &ParseError{"", "bad " + typ + " DigestType", l} return &ParseError{"", "bad " + typ + " DigestType", l}
} }
rr.DigestType = uint8(i) rr.DigestType = uint8(i)
s, e1 := endingToString(c, "bad "+typ+" Digest") s, e2 := endingToString(c, "bad "+typ+" Digest")
if e1 != nil { if e2 != nil {
return e1 return e2
} }
rr.Digest = s rr.Digest = s
return nil return nil
} }
func (rr *DS) parse(c *zlexer, o string) *ParseError {
return rr.parseDS(c, o, "DS")
}
func (rr *DLV) parse(c *zlexer, o string) *ParseError {
return rr.parseDS(c, o, "DLV")
}
func (rr *CDS) parse(c *zlexer, o string) *ParseError {
return rr.parseDS(c, o, "CDS")
}
func (rr *TA) parse(c *zlexer, o string) *ParseError { func (rr *TA) parse(c *zlexer, o string) *ParseError {
l, _ := c.Next() l, _ := c.Next()
i, e := strconv.ParseUint(l.token, 10, 16) i, e := strconv.ParseUint(l.token, 10, 16)
@ -1313,7 +1294,7 @@ func (rr *TA) parse(c *zlexer, o string) *ParseError {
rr.KeyTag = uint16(i) rr.KeyTag = uint16(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
if i, e := strconv.ParseUint(l.token, 10, 8); e != nil { if i, err := strconv.ParseUint(l.token, 10, 8); err != nil {
tokenUpper := strings.ToUpper(l.token) tokenUpper := strings.ToUpper(l.token)
i, ok := StringToAlgorithm[tokenUpper] i, ok := StringToAlgorithm[tokenUpper]
if !ok || l.err { if !ok || l.err {
@ -1325,14 +1306,14 @@ func (rr *TA) parse(c *zlexer, o string) *ParseError {
} }
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
i, e = strconv.ParseUint(l.token, 10, 8) i, e1 := strconv.ParseUint(l.token, 10, 8)
if e != nil || l.err { if e1 != nil || l.err {
return &ParseError{"", "bad TA DigestType", l} return &ParseError{"", "bad TA DigestType", l}
} }
rr.DigestType = uint8(i) rr.DigestType = uint8(i)
s, err := endingToString(c, "bad TA Digest") s, e2 := endingToString(c, "bad TA Digest")
if err != nil { if e2 != nil {
return err return e2
} }
rr.Digest = s rr.Digest = s
return nil return nil
@ -1347,22 +1328,22 @@ func (rr *TLSA) parse(c *zlexer, o string) *ParseError {
rr.Usage = uint8(i) rr.Usage = uint8(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
i, e = strconv.ParseUint(l.token, 10, 8) i, e1 := strconv.ParseUint(l.token, 10, 8)
if e != nil || l.err { if e1 != nil || l.err {
return &ParseError{"", "bad TLSA Selector", l} return &ParseError{"", "bad TLSA Selector", l}
} }
rr.Selector = uint8(i) rr.Selector = uint8(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
i, e = strconv.ParseUint(l.token, 10, 8) i, e2 := strconv.ParseUint(l.token, 10, 8)
if e != nil || l.err { if e2 != nil || l.err {
return &ParseError{"", "bad TLSA MatchingType", l} return &ParseError{"", "bad TLSA MatchingType", l}
} }
rr.MatchingType = uint8(i) rr.MatchingType = uint8(i)
// So this needs be e2 (i.e. different than e), because...??t // So this needs be e2 (i.e. different than e), because...??t
s, e2 := endingToString(c, "bad TLSA Certificate") s, e3 := endingToString(c, "bad TLSA Certificate")
if e2 != nil { if e3 != nil {
return e2 return e3
} }
rr.Certificate = s rr.Certificate = s
return nil return nil
@ -1377,22 +1358,22 @@ func (rr *SMIMEA) parse(c *zlexer, o string) *ParseError {
rr.Usage = uint8(i) rr.Usage = uint8(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
i, e = strconv.ParseUint(l.token, 10, 8) i, e1 := strconv.ParseUint(l.token, 10, 8)
if e != nil || l.err { if e1 != nil || l.err {
return &ParseError{"", "bad SMIMEA Selector", l} return &ParseError{"", "bad SMIMEA Selector", l}
} }
rr.Selector = uint8(i) rr.Selector = uint8(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
i, e = strconv.ParseUint(l.token, 10, 8) i, e2 := strconv.ParseUint(l.token, 10, 8)
if e != nil || l.err { if e2 != nil || l.err {
return &ParseError{"", "bad SMIMEA MatchingType", l} return &ParseError{"", "bad SMIMEA MatchingType", l}
} }
rr.MatchingType = uint8(i) rr.MatchingType = uint8(i)
// So this needs be e2 (i.e. different than e), because...??t // So this needs be e2 (i.e. different than e), because...??t
s, e2 := endingToString(c, "bad SMIMEA Certificate") s, e3 := endingToString(c, "bad SMIMEA Certificate")
if e2 != nil { if e3 != nil {
return e2 return e3
} }
rr.Certificate = s rr.Certificate = s
return nil return nil
@ -1469,16 +1450,16 @@ func (rr *URI) parse(c *zlexer, o string) *ParseError {
rr.Priority = uint16(i) rr.Priority = uint16(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() l, _ = c.Next()
i, e = strconv.ParseUint(l.token, 10, 16) i, e1 := strconv.ParseUint(l.token, 10, 16)
if e != nil || l.err { if e1 != nil || l.err {
return &ParseError{"", "bad URI Weight", l} return &ParseError{"", "bad URI Weight", l}
} }
rr.Weight = uint16(i) rr.Weight = uint16(i)
c.Next() // zBlank c.Next() // zBlank
s, err := endingToTxtSlice(c, "bad URI Target") s, e2 := endingToTxtSlice(c, "bad URI Target")
if err != nil { if e2 != nil {
return err return e2
} }
if len(s) != 1 { if len(s) != 1 {
return &ParseError{"", "bad URI Target", l} return &ParseError{"", "bad URI Target", l}
@ -1506,9 +1487,9 @@ func (rr *NID) parse(c *zlexer, o string) *ParseError {
rr.Preference = uint16(i) rr.Preference = uint16(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() // zString l, _ = c.Next() // zString
u, err := stringToNodeID(l) u, e1 := stringToNodeID(l)
if err != nil || l.err { if e1 != nil || l.err {
return err return e1
} }
rr.NodeID = u rr.NodeID = u
return slurpRemainder(c) return slurpRemainder(c)
@ -1546,7 +1527,6 @@ func (rr *LP) parse(c *zlexer, o string) *ParseError {
return &ParseError{"", "bad LP Fqdn", l} return &ParseError{"", "bad LP Fqdn", l}
} }
rr.Fqdn = name rr.Fqdn = name
return slurpRemainder(c) return slurpRemainder(c)
} }
@ -1559,9 +1539,9 @@ func (rr *L64) parse(c *zlexer, o string) *ParseError {
rr.Preference = uint16(i) rr.Preference = uint16(i)
c.Next() // zBlank c.Next() // zBlank
l, _ = c.Next() // zString l, _ = c.Next() // zString
u, err := stringToNodeID(l) u, e1 := stringToNodeID(l)
if err != nil || l.err { if e1 != nil || l.err {
return err return e1
} }
rr.Locator64 = u rr.Locator64 = u
return slurpRemainder(c) return slurpRemainder(c)
@ -1624,14 +1604,13 @@ func (rr *PX) parse(c *zlexer, o string) *ParseError {
return &ParseError{"", "bad PX Mapx400", l} return &ParseError{"", "bad PX Mapx400", l}
} }
rr.Mapx400 = mapx400 rr.Mapx400 = mapx400
return slurpRemainder(c) return slurpRemainder(c)
} }
func (rr *CAA) parse(c *zlexer, o string) *ParseError { func (rr *CAA) parse(c *zlexer, o string) *ParseError {
l, _ := c.Next() l, _ := c.Next()
i, err := strconv.ParseUint(l.token, 10, 8) i, e := strconv.ParseUint(l.token, 10, 8)
if err != nil || l.err { if e != nil || l.err {
return &ParseError{"", "bad CAA Flag", l} return &ParseError{"", "bad CAA Flag", l}
} }
rr.Flag = uint8(i) rr.Flag = uint8(i)
@ -1644,9 +1623,9 @@ func (rr *CAA) parse(c *zlexer, o string) *ParseError {
rr.Tag = l.token rr.Tag = l.token
c.Next() // zBlank c.Next() // zBlank
s, e := endingToTxtSlice(c, "bad CAA Value") s, e1 := endingToTxtSlice(c, "bad CAA Value")
if e != nil { if e1 != nil {
return e return e1
} }
if len(s) != 1 { if len(s) != 1 {
return &ParseError{"", "bad CAA Value", l} return &ParseError{"", "bad CAA Value", l}
@ -1667,8 +1646,8 @@ func (rr *TKEY) parse(c *zlexer, o string) *ParseError {
// Get the key length and key values // Get the key length and key values
l, _ = c.Next() l, _ = c.Next()
i, err := strconv.ParseUint(l.token, 10, 8) i, e := strconv.ParseUint(l.token, 10, 8)
if err != nil || l.err { if e != nil || l.err {
return &ParseError{"", "bad TKEY key length", l} return &ParseError{"", "bad TKEY key length", l}
} }
rr.KeySize = uint16(i) rr.KeySize = uint16(i)
@ -1682,8 +1661,8 @@ func (rr *TKEY) parse(c *zlexer, o string) *ParseError {
// Get the otherdata length and string data // Get the otherdata length and string data
l, _ = c.Next() l, _ = c.Next()
i, err = strconv.ParseUint(l.token, 10, 8) i, e1 := strconv.ParseUint(l.token, 10, 8)
if err != nil || l.err { if e1 != nil || l.err {
return &ParseError{"", "bad TKEY otherdata length", l} return &ParseError{"", "bad TKEY otherdata length", l}
} }
rr.OtherLen = uint16(i) rr.OtherLen = uint16(i)
@ -1693,7 +1672,6 @@ func (rr *TKEY) parse(c *zlexer, o string) *ParseError {
return &ParseError{"", "bad TKEY otherday", l} return &ParseError{"", "bad TKEY otherday", l}
} }
rr.OtherData = l.token rr.OtherData = l.token
return nil return nil
} }
@ -1727,9 +1705,9 @@ func (rr *APL) parse(c *zlexer, o string) *ParseError {
family = family[1:] family = family[1:]
} }
afi, err := strconv.ParseUint(family, 10, 16) afi, e := strconv.ParseUint(family, 10, 16)
if err != nil { if e != nil {
return &ParseError{"", "failed to parse APL family: " + err.Error(), l} return &ParseError{"", "failed to parse APL family: " + e.Error(), l}
} }
var addrLen int var addrLen int
switch afi { switch afi {
@ -1741,9 +1719,9 @@ func (rr *APL) parse(c *zlexer, o string) *ParseError {
return &ParseError{"", "unrecognized APL family", l} return &ParseError{"", "unrecognized APL family", l}
} }
ip, subnet, err := net.ParseCIDR(cidr) ip, subnet, e1 := net.ParseCIDR(cidr)
if err != nil { if e1 != nil {
return &ParseError{"", "failed to parse APL address: " + err.Error(), l} return &ParseError{"", "failed to parse APL address: " + e1.Error(), l}
} }
if !ip.Equal(subnet.IP) { if !ip.Equal(subnet.IP) {
return &ParseError{"", "extra bits in APL address", l} return &ParseError{"", "extra bits in APL address", l}

View file

@ -165,11 +165,11 @@ const (
_RD = 1 << 8 // recursion desired _RD = 1 << 8 // recursion desired
_RA = 1 << 7 // recursion available _RA = 1 << 7 // recursion available
_Z = 1 << 6 // Z _Z = 1 << 6 // Z
_AD = 1 << 5 // authticated data _AD = 1 << 5 // authenticated data
_CD = 1 << 4 // checking disabled _CD = 1 << 4 // checking disabled
) )
// Various constants used in the LOC RR, See RFC 1887. // Various constants used in the LOC RR. See RFC 1887.
const ( const (
LOC_EQUATOR = 1 << 31 // RFC 1876, Section 2. LOC_EQUATOR = 1 << 31 // RFC 1876, Section 2.
LOC_PRIMEMERIDIAN = 1 << 31 // RFC 1876, Section 2. LOC_PRIMEMERIDIAN = 1 << 31 // RFC 1876, Section 2.
@ -760,7 +760,7 @@ type LOC struct {
} }
// cmToM takes a cm value expressed in RFC 1876 SIZE mantissa/exponent // cmToM takes a cm value expressed in RFC 1876 SIZE mantissa/exponent
// format and returns a string in m (two decimals for the cm) // format and returns a string in m (two decimals for the cm).
func cmToM(m, e uint8) string { func cmToM(m, e uint8) string {
if e < 2 { if e < 2 {
if e == 1 { if e == 1 {

View file

@ -3,13 +3,13 @@ package dns
import "fmt" import "fmt"
// Version is current version of this library. // Version is current version of this library.
var Version = V{1, 1, 27} var Version = v{1, 1, 28}
// V holds the version of this library. // v holds the version of this library.
type V struct { type v struct {
Major, Minor, Patch int Major, Minor, Patch int
} }
func (v V) String() string { func (v v) String() string {
return fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Patch) return fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Patch)
} }

9
vendor/golang.org/x/sys/cpu/cpu.go generated vendored
View file

@ -114,6 +114,15 @@ var ARM struct {
_ CacheLinePad _ CacheLinePad
} }
// MIPS64X contains the supported CPU features of the current mips64/mips64le
// platforms. If the current platform is not mips64/mips64le or the current
// operating system is not Linux then all feature flags are false.
var MIPS64X struct {
_ CacheLinePad
HasMSA bool // MIPS SIMD architecture
_ CacheLinePad
}
// PPC64 contains the supported CPU features of the current ppc64/ppc64le platforms. // PPC64 contains the supported CPU features of the current ppc64/ppc64le platforms.
// If the current platform is not ppc64/ppc64le then all feature flags are false. // If the current platform is not ppc64/ppc64le then all feature flags are false.
// //

22
vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go generated vendored Normal file
View file

@ -0,0 +1,22 @@
// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build mips64 mips64le
package cpu
// HWCAP bits. These are exposed by the Linux kernel 5.4.
const (
// CPU features
hwcap_MIPS_MSA = 1 << 1
)
func doinit() {
// HWCAP feature bits
MIPS64X.HasMSA = isSet(hwCap, hwcap_MIPS_MSA)
}
func isSet(hwc uint, value uint) bool {
return hwc&value != 0
}

View file

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build linux,!arm,!arm64,!ppc64,!ppc64le,!s390x // +build linux,!arm,!arm64,!mips64,!mips64le,!ppc64,!ppc64le,!s390x
package cpu package cpu

View file

@ -149,6 +149,17 @@ To add a constant, add the header that includes it to the appropriate variable.
Then, edit the regex (if necessary) to match the desired constant. Avoid making Then, edit the regex (if necessary) to match the desired constant. Avoid making
the regex too broad to avoid matching unintended constants. the regex too broad to avoid matching unintended constants.
### mkmerge.go
This program is used to extract duplicate const, func, and type declarations
from the generated architecture-specific files listed below, and merge these
into a common file for each OS.
The merge is performed in the following steps:
1. Construct the set of common code that is idential in all architecture-specific files.
2. Write this common code to the merged file.
3. Remove the common code from all architecture-specific files.
## Generated files ## Generated files

2453
vendor/golang.org/x/sys/unix/zerrors_linux.go generated vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

1825
vendor/golang.org/x/sys/unix/zsyscall_linux.go generated vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

2274
vendor/golang.org/x/sys/unix/ztypes_linux.go generated vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

8
vendor/modules.txt vendored
View file

@ -44,7 +44,7 @@ github.com/jedisct1/xsecretbox
github.com/k-sone/critbitgo github.com/k-sone/critbitgo
# github.com/kardianos/service v1.0.1-0.20191211031725-3c356ae54c8a # github.com/kardianos/service v1.0.1-0.20191211031725-3c356ae54c8a
github.com/kardianos/service github.com/kardianos/service
# github.com/miekg/dns v1.1.27 # github.com/miekg/dns v1.1.28
github.com/miekg/dns github.com/miekg/dns
# github.com/pkg/errors v0.8.1 # github.com/pkg/errors v0.8.1
github.com/pkg/errors github.com/pkg/errors
@ -55,7 +55,7 @@ github.com/powerman/check
# github.com/smartystreets/goconvey v1.6.4 # github.com/smartystreets/goconvey v1.6.4
github.com/smartystreets/goconvey/convey/gotest github.com/smartystreets/goconvey/convey/gotest
github.com/smartystreets/goconvey/convey/reporting github.com/smartystreets/goconvey/convey/reporting
# golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d # golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4
golang.org/x/crypto/blake2b golang.org/x/crypto/blake2b
golang.org/x/crypto/curve25519 golang.org/x/crypto/curve25519
golang.org/x/crypto/ed25519 golang.org/x/crypto/ed25519
@ -65,7 +65,7 @@ golang.org/x/crypto/nacl/box
golang.org/x/crypto/nacl/secretbox golang.org/x/crypto/nacl/secretbox
golang.org/x/crypto/poly1305 golang.org/x/crypto/poly1305
golang.org/x/crypto/salsa20/salsa golang.org/x/crypto/salsa20/salsa
# golang.org/x/net v0.0.0-20200226121028-0de0cce0169b # golang.org/x/net v0.0.0-20200301022130-244492dfa37a
golang.org/x/net/bpf golang.org/x/net/bpf
golang.org/x/net/http/httpguts golang.org/x/net/http/httpguts
golang.org/x/net/http2 golang.org/x/net/http2
@ -77,7 +77,7 @@ golang.org/x/net/internal/socks
golang.org/x/net/ipv4 golang.org/x/net/ipv4
golang.org/x/net/ipv6 golang.org/x/net/ipv6
golang.org/x/net/proxy golang.org/x/net/proxy
# golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae # golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527
golang.org/x/sys/cpu golang.org/x/sys/cpu
golang.org/x/sys/unix golang.org/x/sys/unix
golang.org/x/sys/windows golang.org/x/sys/windows