[chore]: Bump github.com/miekg/dns from 1.1.51 to 1.1.52 (#1636)

Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.51 to 1.1.52.
- [Release notes](https://github.com/miekg/dns/releases)
- [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release)
- [Commits](https://github.com/miekg/dns/compare/v1.1.51...v1.1.52)

---
updated-dependencies:
- dependency-name: github.com/miekg/dns
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
dependabot[bot] 2023-03-20 11:36:34 +01:00 committed by GitHub
parent 78aebf5088
commit 276d773438
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 443 additions and 176 deletions

2
go.mod
View file

@ -35,7 +35,7 @@ require (
github.com/jackc/pgconn v1.14.0 github.com/jackc/pgconn v1.14.0
github.com/jackc/pgx/v4 v4.18.1 github.com/jackc/pgx/v4 v4.18.1
github.com/microcosm-cc/bluemonday v1.0.23 github.com/microcosm-cc/bluemonday v1.0.23
github.com/miekg/dns v1.1.51 github.com/miekg/dns v1.1.52
github.com/minio/minio-go/v7 v7.0.49 github.com/minio/minio-go/v7 v7.0.49
github.com/mitchellh/mapstructure v1.5.0 github.com/mitchellh/mapstructure v1.5.0
github.com/oklog/ulid v1.3.1 github.com/oklog/ulid v1.3.1

10
go.sum
View file

@ -444,8 +444,8 @@ github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/
github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
github.com/microcosm-cc/bluemonday v1.0.23 h1:SMZe2IGa0NuHvnVNAZ+6B38gsTbi5e4sViiWJyDDqFY= github.com/microcosm-cc/bluemonday v1.0.23 h1:SMZe2IGa0NuHvnVNAZ+6B38gsTbi5e4sViiWJyDDqFY=
github.com/microcosm-cc/bluemonday v1.0.23/go.mod h1:mN70sk7UkkF8TUr2IGBpNN0jAgStuPzlK76QuruE/z4= github.com/microcosm-cc/bluemonday v1.0.23/go.mod h1:mN70sk7UkkF8TUr2IGBpNN0jAgStuPzlK76QuruE/z4=
github.com/miekg/dns v1.1.51 h1:0+Xg7vObnhrz/4ZCZcZh7zPXlmU0aveS2HDBd0m0qSo= github.com/miekg/dns v1.1.52 h1:Bmlc/qsNNULOe6bpXcUTsuOajd0DzRHwup6D9k1An0c=
github.com/miekg/dns v1.1.51/go.mod h1:2Z9d3CP1LQWihRZUf29mQ19yDThaI4DAYzte2CaQW5c= github.com/miekg/dns v1.1.52/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY=
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
github.com/minio/minio-go/v7 v7.0.49 h1:dE5DfOtnXMXCjr/HWI6zN9vCrY6Sv666qhhiwUMvGV4= github.com/minio/minio-go/v7 v7.0.49 h1:dE5DfOtnXMXCjr/HWI6zN9vCrY6Sv666qhhiwUMvGV4=
@ -711,7 +711,6 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -750,7 +749,6 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
@ -841,7 +839,6 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
@ -849,7 +846,6 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw=
@ -861,7 +857,6 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
@ -925,7 +920,6 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k=
golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

View file

@ -106,7 +106,6 @@ func (c *Client) Dial(address string) (conn *Conn, err error) {
} }
// DialContext connects to the address on the named network, with a context.Context. // DialContext connects to the address on the named network, with a context.Context.
// For TLS over TCP (DoT) the context isn't used yet. This will be enabled when Go 1.18 is released.
func (c *Client) DialContext(ctx context.Context, address string) (conn *Conn, err error) { func (c *Client) DialContext(ctx context.Context, address string) (conn *Conn, err error) {
// create a new dialer with the appropriate timeout // create a new dialer with the appropriate timeout
var d net.Dialer var d net.Dialer
@ -127,15 +126,11 @@ func (c *Client) DialContext(ctx context.Context, address string) (conn *Conn, e
if useTLS { if useTLS {
network = strings.TrimSuffix(network, "-tls") network = strings.TrimSuffix(network, "-tls")
// TODO(miekg): Enable after Go 1.18 is released, to be able to support two prev. releases. tlsDialer := tls.Dialer{
/* NetDialer: &d,
tlsDialer := tls.Dialer{ Config: c.TLSConfig,
NetDialer: &d, }
Config: c.TLSConfig, conn.Conn, err = tlsDialer.DialContext(ctx, network, address)
}
conn.Conn, err = tlsDialer.DialContext(ctx, network, address)
*/
conn.Conn, err = tls.DialWithDialer(&d, network, address, c.TLSConfig)
} else { } else {
conn.Conn, err = d.DialContext(ctx, network, address) conn.Conn, err = d.DialContext(ctx, network, address)
} }

View file

@ -68,7 +68,7 @@ func ClientConfigFromReader(resolvconf io.Reader) (*ClientConfig, error) {
} }
case "search": // set search path to given servers case "search": // set search path to given servers
c.Search = append([]string(nil), f[1:]...) c.Search = cloneSlice(f[1:])
case "options": // magic options case "options": // magic options
for _, s := range f[1:] { for _, s := range f[1:] {

45
vendor/github.com/miekg/dns/edns.go generated vendored
View file

@ -263,7 +263,7 @@ func (e *EDNS0_NSID) copy() EDNS0 { return &EDNS0_NSID{e.Code, e.Nsid}
// o.Hdr.Name = "." // o.Hdr.Name = "."
// o.Hdr.Rrtype = dns.TypeOPT // o.Hdr.Rrtype = dns.TypeOPT
// e := new(dns.EDNS0_SUBNET) // e := new(dns.EDNS0_SUBNET)
// e.Code = dns.EDNS0SUBNET // by default this is filled in through unpacking OPT packets (unpackDataOpt) // e.Code = dns.EDNS0SUBNET // by default this is filled in through unpacking OPT packets (unpackDataOpt)
// e.Family = 1 // 1 for IPv4 source address, 2 for IPv6 // e.Family = 1 // 1 for IPv4 source address, 2 for IPv6
// e.SourceNetmask = 32 // 32 for IPV4, 128 for IPv6 // e.SourceNetmask = 32 // 32 for IPV4, 128 for IPv6
// e.SourceScope = 0 // e.SourceScope = 0
@ -520,8 +520,8 @@ type EDNS0_DAU struct {
// Option implements the EDNS0 interface. // Option implements the EDNS0 interface.
func (e *EDNS0_DAU) Option() uint16 { return EDNS0DAU } func (e *EDNS0_DAU) Option() uint16 { return EDNS0DAU }
func (e *EDNS0_DAU) pack() ([]byte, error) { return e.AlgCode, nil } func (e *EDNS0_DAU) pack() ([]byte, error) { return cloneSlice(e.AlgCode), nil }
func (e *EDNS0_DAU) unpack(b []byte) error { e.AlgCode = b; return nil } func (e *EDNS0_DAU) unpack(b []byte) error { e.AlgCode = cloneSlice(b); return nil }
func (e *EDNS0_DAU) String() string { func (e *EDNS0_DAU) String() string {
s := "" s := ""
@ -544,8 +544,8 @@ type EDNS0_DHU struct {
// Option implements the EDNS0 interface. // Option implements the EDNS0 interface.
func (e *EDNS0_DHU) Option() uint16 { return EDNS0DHU } func (e *EDNS0_DHU) Option() uint16 { return EDNS0DHU }
func (e *EDNS0_DHU) pack() ([]byte, error) { return e.AlgCode, nil } func (e *EDNS0_DHU) pack() ([]byte, error) { return cloneSlice(e.AlgCode), nil }
func (e *EDNS0_DHU) unpack(b []byte) error { e.AlgCode = b; return nil } func (e *EDNS0_DHU) unpack(b []byte) error { e.AlgCode = cloneSlice(b); return nil }
func (e *EDNS0_DHU) String() string { func (e *EDNS0_DHU) String() string {
s := "" s := ""
@ -568,8 +568,8 @@ type EDNS0_N3U struct {
// Option implements the EDNS0 interface. // Option implements the EDNS0 interface.
func (e *EDNS0_N3U) Option() uint16 { return EDNS0N3U } func (e *EDNS0_N3U) Option() uint16 { return EDNS0N3U }
func (e *EDNS0_N3U) pack() ([]byte, error) { return e.AlgCode, nil } func (e *EDNS0_N3U) pack() ([]byte, error) { return cloneSlice(e.AlgCode), nil }
func (e *EDNS0_N3U) unpack(b []byte) error { e.AlgCode = b; return nil } func (e *EDNS0_N3U) unpack(b []byte) error { e.AlgCode = cloneSlice(b); return nil }
func (e *EDNS0_N3U) String() string { func (e *EDNS0_N3U) String() string {
// Re-use the hash map // Re-use the hash map
@ -646,30 +646,21 @@ type EDNS0_LOCAL struct {
// Option implements the EDNS0 interface. // Option implements the EDNS0 interface.
func (e *EDNS0_LOCAL) Option() uint16 { return e.Code } func (e *EDNS0_LOCAL) Option() uint16 { return e.Code }
func (e *EDNS0_LOCAL) String() string { func (e *EDNS0_LOCAL) String() string {
return strconv.FormatInt(int64(e.Code), 10) + ":0x" + hex.EncodeToString(e.Data) return strconv.FormatInt(int64(e.Code), 10) + ":0x" + hex.EncodeToString(e.Data)
} }
func (e *EDNS0_LOCAL) copy() EDNS0 { func (e *EDNS0_LOCAL) copy() EDNS0 {
b := make([]byte, len(e.Data)) return &EDNS0_LOCAL{e.Code, cloneSlice(e.Data)}
copy(b, e.Data)
return &EDNS0_LOCAL{e.Code, b}
} }
func (e *EDNS0_LOCAL) pack() ([]byte, error) { func (e *EDNS0_LOCAL) pack() ([]byte, error) {
b := make([]byte, len(e.Data)) return cloneSlice(e.Data), nil
copied := copy(b, e.Data)
if copied != len(e.Data) {
return nil, ErrBuf
}
return b, nil
} }
func (e *EDNS0_LOCAL) unpack(b []byte) error { func (e *EDNS0_LOCAL) unpack(b []byte) error {
e.Data = make([]byte, len(b)) e.Data = cloneSlice(b)
copied := copy(e.Data, b)
if copied != len(b) {
return ErrBuf
}
return nil return nil
} }
@ -732,14 +723,10 @@ type EDNS0_PADDING struct {
// Option implements the EDNS0 interface. // Option implements the EDNS0 interface.
func (e *EDNS0_PADDING) Option() uint16 { return EDNS0PADDING } func (e *EDNS0_PADDING) Option() uint16 { return EDNS0PADDING }
func (e *EDNS0_PADDING) pack() ([]byte, error) { return e.Padding, nil } func (e *EDNS0_PADDING) pack() ([]byte, error) { return cloneSlice(e.Padding), nil }
func (e *EDNS0_PADDING) unpack(b []byte) error { e.Padding = b; return nil } func (e *EDNS0_PADDING) unpack(b []byte) error { e.Padding = cloneSlice(b); return nil }
func (e *EDNS0_PADDING) String() string { return fmt.Sprintf("%0X", e.Padding) } func (e *EDNS0_PADDING) String() string { return fmt.Sprintf("%0X", e.Padding) }
func (e *EDNS0_PADDING) copy() EDNS0 { func (e *EDNS0_PADDING) copy() EDNS0 { return &EDNS0_PADDING{cloneSlice(e.Padding)} }
b := make([]byte, len(e.Padding))
copy(b, e.Padding)
return &EDNS0_PADDING{b}
}
// Extended DNS Error Codes (RFC 8914). // Extended DNS Error Codes (RFC 8914).
const ( const (
@ -826,7 +813,7 @@ func (e *EDNS0_EDE) String() string {
func (e *EDNS0_EDE) pack() ([]byte, error) { func (e *EDNS0_EDE) pack() ([]byte, error) {
b := make([]byte, 2+len(e.ExtraText)) b := make([]byte, 2+len(e.ExtraText))
binary.BigEndian.PutUint16(b[0:], e.InfoCode) binary.BigEndian.PutUint16(b[0:], e.InfoCode)
copy(b[2:], []byte(e.ExtraText)) copy(b[2:], e.ExtraText)
return b, nil return b, nil
} }

View file

@ -1,5 +1,5 @@
//go:build !go1.11 || (!aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd) //go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd
// +build !go1.11 !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd // +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd
package dns package dns

View file

@ -1,5 +1,4 @@
//go:build go1.11 && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd) //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd
// +build go1.11
// +build aix darwin dragonfly freebsd linux netbsd openbsd // +build aix darwin dragonfly freebsd linux netbsd openbsd
package dns package dns

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

@ -448,7 +448,7 @@ Loop:
return string(s), off1, nil return string(s), off1, nil
} }
func packTxt(txt []string, msg []byte, offset int, tmp []byte) (int, error) { func packTxt(txt []string, msg []byte, offset int) (int, error) {
if len(txt) == 0 { if len(txt) == 0 {
if offset >= len(msg) { if offset >= len(msg) {
return offset, ErrBuf return offset, ErrBuf
@ -458,10 +458,7 @@ func packTxt(txt []string, msg []byte, offset int, tmp []byte) (int, error) {
} }
var err error var err error
for _, s := range txt { for _, s := range txt {
if len(s) > len(tmp) { offset, err = packTxtString(s, msg, offset)
return offset, ErrBuf
}
offset, err = packTxtString(s, msg, offset, tmp)
if err != nil { if err != nil {
return offset, err return offset, err
} }
@ -469,32 +466,30 @@ func packTxt(txt []string, msg []byte, offset int, tmp []byte) (int, error) {
return offset, nil return offset, nil
} }
func packTxtString(s string, msg []byte, offset int, tmp []byte) (int, error) { func packTxtString(s string, msg []byte, offset int) (int, error) {
lenByteOffset := offset lenByteOffset := offset
if offset >= len(msg) || len(s) > len(tmp) { if offset >= len(msg) || len(s) > 256*4+1 /* If all \DDD */ {
return offset, ErrBuf return offset, ErrBuf
} }
offset++ offset++
bs := tmp[:len(s)] for i := 0; i < len(s); i++ {
copy(bs, s)
for i := 0; i < len(bs); i++ {
if len(msg) <= offset { if len(msg) <= offset {
return offset, ErrBuf return offset, ErrBuf
} }
if bs[i] == '\\' { if s[i] == '\\' {
i++ i++
if i == len(bs) { if i == len(s) {
break break
} }
// check for \DDD // check for \DDD
if i+2 < len(bs) && isDigit(bs[i]) && isDigit(bs[i+1]) && isDigit(bs[i+2]) { if i+2 < len(s) && isDigit(s[i]) && isDigit(s[i+1]) && isDigit(s[i+2]) {
msg[offset] = dddToByte(bs[i:]) msg[offset] = dddStringToByte(s[i:])
i += 2 i += 2
} else { } else {
msg[offset] = bs[i] msg[offset] = s[i]
} }
} else { } else {
msg[offset] = bs[i] msg[offset] = s[i]
} }
offset++ offset++
} }
@ -1065,8 +1060,8 @@ func (dns *Msg) CopyTo(r1 *Msg) *Msg {
r1.Compress = dns.Compress r1.Compress = dns.Compress
if len(dns.Question) > 0 { if len(dns.Question) > 0 {
r1.Question = make([]Question, len(dns.Question)) // TODO(miek): Question is an immutable value, ok to do a shallow-copy
copy(r1.Question, dns.Question) // TODO(miek): Question is an immutable value, ok to do a shallow-copy r1.Question = cloneSlice(dns.Question)
} }
rrArr := make([]RR, len(dns.Answer)+len(dns.Ns)+len(dns.Extra)) rrArr := make([]RR, len(dns.Answer)+len(dns.Ns)+len(dns.Extra))

View file

@ -299,8 +299,7 @@ func unpackString(msg []byte, off int) (string, int, error) {
} }
func packString(s string, msg []byte, off int) (int, error) { func packString(s string, msg []byte, off int) (int, error) {
txtTmp := make([]byte, 256*4+1) off, err := packTxtString(s, msg, off)
off, err := packTxtString(s, msg, off, txtTmp)
if err != nil { if err != nil {
return len(msg), err return len(msg), err
} }
@ -402,8 +401,7 @@ func unpackStringTxt(msg []byte, off int) ([]string, int, error) {
} }
func packStringTxt(s []string, msg []byte, off int) (int, error) { func packStringTxt(s []string, msg []byte, off int) (int, error) {
txtTmp := make([]byte, 256*4+1) // If the whole string consists out of \DDD we need this many. off, err := packTxt(s, msg, off)
off, err := packTxt(s, msg, off, txtTmp)
if err != nil { if err != nil {
return len(msg), err return len(msg), err
} }
@ -625,7 +623,7 @@ func unpackDataSVCB(msg []byte, off int) ([]SVCBKeyValue, int, error) {
} }
func packDataSVCB(pairs []SVCBKeyValue, msg []byte, off int) (int, error) { func packDataSVCB(pairs []SVCBKeyValue, msg []byte, off int) (int, error) {
pairs = append([]SVCBKeyValue(nil), pairs...) pairs = cloneSlice(pairs)
sort.Slice(pairs, func(i, j int) bool { sort.Slice(pairs, func(i, j int) bool {
return pairs[i].Key() < pairs[j].Key() return pairs[i].Key() < pairs[j].Key()
}) })

View file

@ -1249,7 +1249,7 @@ func (rr *IPSECKEY) parse(c *zlexer, o string) *ParseError {
rr.GatewayAddr, rr.GatewayHost, err = parseAddrHostUnion(l.token, o, rr.GatewayType) rr.GatewayAddr, rr.GatewayHost, err = parseAddrHostUnion(l.token, o, rr.GatewayType)
if err != nil { if err != nil {
return &ParseError{"", "AMTRELAY " + err.Error(), l} return &ParseError{"", "IPSECKEY " + err.Error(), l}
} }
c.Next() // zBlank c.Next() // zBlank

View file

@ -224,7 +224,7 @@ type Server struct {
// Maximum number of TCP queries before we close the socket. Default is maxTCPQueries (unlimited if -1). // Maximum number of TCP queries before we close the socket. Default is maxTCPQueries (unlimited if -1).
MaxTCPQueries int MaxTCPQueries int
// Whether to set the SO_REUSEPORT socket option, allowing multiple listeners to be bound to a single address. // Whether to set the SO_REUSEPORT socket option, allowing multiple listeners to be bound to a single address.
// It is only supported on go1.11+ and when using ListenAndServe. // It is only supported on certain GOOSes and when using ListenAndServe.
ReusePort bool ReusePort bool
// AcceptMsgFunc will check the incoming message and will reject it early in the process. // AcceptMsgFunc will check the incoming message and will reject it early in the process.
// By default DefaultMsgAcceptFunc will be used. // By default DefaultMsgAcceptFunc will be used.

47
vendor/github.com/miekg/dns/svcb.go generated vendored
View file

@ -289,7 +289,7 @@ func (s *SVCBMandatory) String() string {
} }
func (s *SVCBMandatory) pack() ([]byte, error) { func (s *SVCBMandatory) pack() ([]byte, error) {
codes := append([]SVCBKey(nil), s.Code...) codes := cloneSlice(s.Code)
sort.Slice(codes, func(i, j int) bool { sort.Slice(codes, func(i, j int) bool {
return codes[i] < codes[j] return codes[i] < codes[j]
}) })
@ -328,9 +328,7 @@ func (s *SVCBMandatory) len() int {
} }
func (s *SVCBMandatory) copy() SVCBKeyValue { func (s *SVCBMandatory) copy() SVCBKeyValue {
return &SVCBMandatory{ return &SVCBMandatory{cloneSlice(s.Code)}
append([]SVCBKey(nil), s.Code...),
}
} }
// SVCBAlpn pair is used to list supported connection protocols. // SVCBAlpn pair is used to list supported connection protocols.
@ -481,9 +479,7 @@ func (s *SVCBAlpn) len() int {
} }
func (s *SVCBAlpn) copy() SVCBKeyValue { func (s *SVCBAlpn) copy() SVCBKeyValue {
return &SVCBAlpn{ return &SVCBAlpn{cloneSlice(s.Alpn)}
append([]string(nil), s.Alpn...),
}
} }
// SVCBNoDefaultAlpn pair signifies no support for default connection protocols. // SVCBNoDefaultAlpn pair signifies no support for default connection protocols.
@ -595,6 +591,7 @@ func (s *SVCBIPv4Hint) unpack(b []byte) error {
if len(b) == 0 || len(b)%4 != 0 { if len(b) == 0 || len(b)%4 != 0 {
return errors.New("dns: svcbipv4hint: ipv4 address byte array length is not a multiple of 4") return errors.New("dns: svcbipv4hint: ipv4 address byte array length is not a multiple of 4")
} }
b = cloneSlice(b)
x := make([]net.IP, 0, len(b)/4) x := make([]net.IP, 0, len(b)/4)
for i := 0; i < len(b); i += 4 { for i := 0; i < len(b); i += 4 {
x = append(x, net.IP(b[i:i+4])) x = append(x, net.IP(b[i:i+4]))
@ -635,12 +632,9 @@ func (s *SVCBIPv4Hint) parse(b string) error {
func (s *SVCBIPv4Hint) copy() SVCBKeyValue { func (s *SVCBIPv4Hint) copy() SVCBKeyValue {
hint := make([]net.IP, len(s.Hint)) hint := make([]net.IP, len(s.Hint))
for i, ip := range s.Hint { for i, ip := range s.Hint {
hint[i] = copyIP(ip) hint[i] = cloneSlice(ip)
}
return &SVCBIPv4Hint{
Hint: hint,
} }
return &SVCBIPv4Hint{Hint: hint}
} }
// SVCBECHConfig pair contains the ECHConfig structure defined in draft-ietf-tls-esni [RFC xxxx]. // SVCBECHConfig pair contains the ECHConfig structure defined in draft-ietf-tls-esni [RFC xxxx].
@ -660,19 +654,18 @@ func (s *SVCBECHConfig) String() string { return toBase64(s.ECH) }
func (s *SVCBECHConfig) len() int { return len(s.ECH) } func (s *SVCBECHConfig) len() int { return len(s.ECH) }
func (s *SVCBECHConfig) pack() ([]byte, error) { func (s *SVCBECHConfig) pack() ([]byte, error) {
return append([]byte(nil), s.ECH...), nil return cloneSlice(s.ECH), nil
} }
func (s *SVCBECHConfig) copy() SVCBKeyValue { func (s *SVCBECHConfig) copy() SVCBKeyValue {
return &SVCBECHConfig{ return &SVCBECHConfig{cloneSlice(s.ECH)}
append([]byte(nil), s.ECH...),
}
} }
func (s *SVCBECHConfig) unpack(b []byte) error { func (s *SVCBECHConfig) unpack(b []byte) error {
s.ECH = append([]byte(nil), b...) s.ECH = cloneSlice(b)
return nil return nil
} }
func (s *SVCBECHConfig) parse(b string) error { func (s *SVCBECHConfig) parse(b string) error {
x, err := fromBase64([]byte(b)) x, err := fromBase64([]byte(b))
if err != nil { if err != nil {
@ -715,6 +708,7 @@ func (s *SVCBIPv6Hint) unpack(b []byte) error {
if len(b) == 0 || len(b)%16 != 0 { if len(b) == 0 || len(b)%16 != 0 {
return errors.New("dns: svcbipv6hint: ipv6 address byte array length not a multiple of 16") return errors.New("dns: svcbipv6hint: ipv6 address byte array length not a multiple of 16")
} }
b = cloneSlice(b)
x := make([]net.IP, 0, len(b)/16) x := make([]net.IP, 0, len(b)/16)
for i := 0; i < len(b); i += 16 { for i := 0; i < len(b); i += 16 {
ip := net.IP(b[i : i+16]) ip := net.IP(b[i : i+16])
@ -758,12 +752,9 @@ func (s *SVCBIPv6Hint) parse(b string) error {
func (s *SVCBIPv6Hint) copy() SVCBKeyValue { func (s *SVCBIPv6Hint) copy() SVCBKeyValue {
hint := make([]net.IP, len(s.Hint)) hint := make([]net.IP, len(s.Hint))
for i, ip := range s.Hint { for i, ip := range s.Hint {
hint[i] = copyIP(ip) hint[i] = cloneSlice(ip)
}
return &SVCBIPv6Hint{
Hint: hint,
} }
return &SVCBIPv6Hint{Hint: hint}
} }
// SVCBDoHPath pair is used to indicate the URI template that the // SVCBDoHPath pair is used to indicate the URI template that the
@ -831,11 +822,11 @@ type SVCBLocal struct {
func (s *SVCBLocal) Key() SVCBKey { return s.KeyCode } func (s *SVCBLocal) Key() SVCBKey { return s.KeyCode }
func (s *SVCBLocal) String() string { return svcbParamToStr(s.Data) } func (s *SVCBLocal) String() string { return svcbParamToStr(s.Data) }
func (s *SVCBLocal) pack() ([]byte, error) { return append([]byte(nil), s.Data...), nil } func (s *SVCBLocal) pack() ([]byte, error) { return cloneSlice(s.Data), nil }
func (s *SVCBLocal) len() int { return len(s.Data) } func (s *SVCBLocal) len() int { return len(s.Data) }
func (s *SVCBLocal) unpack(b []byte) error { func (s *SVCBLocal) unpack(b []byte) error {
s.Data = append([]byte(nil), b...) s.Data = cloneSlice(b)
return nil return nil
} }
@ -849,9 +840,7 @@ func (s *SVCBLocal) parse(b string) error {
} }
func (s *SVCBLocal) copy() SVCBKeyValue { func (s *SVCBLocal) copy() SVCBKeyValue {
return &SVCBLocal{s.KeyCode, return &SVCBLocal{s.KeyCode, cloneSlice(s.Data)}
append([]byte(nil), s.Data...),
}
} }
func (rr *SVCB) String() string { func (rr *SVCB) String() string {
@ -867,8 +856,8 @@ func (rr *SVCB) String() string {
// areSVCBPairArraysEqual checks if SVCBKeyValue arrays are equal after sorting their // areSVCBPairArraysEqual checks if SVCBKeyValue arrays are equal after sorting their
// copies. arrA and arrB have equal lengths, otherwise zduplicate.go wouldn't call this function. // copies. arrA and arrB have equal lengths, otherwise zduplicate.go wouldn't call this function.
func areSVCBPairArraysEqual(a []SVCBKeyValue, b []SVCBKeyValue) bool { func areSVCBPairArraysEqual(a []SVCBKeyValue, b []SVCBKeyValue) bool {
a = append([]SVCBKeyValue(nil), a...) a = cloneSlice(a)
b = append([]SVCBKeyValue(nil), b...) b = cloneSlice(b)
sort.Slice(a, func(i, j int) bool { return a[i].Key() < a[j].Key() }) sort.Slice(a, func(i, j int) bool { return a[i].Key() < a[j].Key() })
sort.Slice(b, func(i, j int) bool { return b[i].Key() < b[j].Key() }) sort.Slice(b, func(i, j int) bool { return b[i].Key() < b[j].Key() })
for i, e := range a { for i, e := range a {

20
vendor/github.com/miekg/dns/types.go generated vendored
View file

@ -1531,7 +1531,7 @@ func (a *APLPrefix) str() string {
// equals reports whether two APL prefixes are identical. // equals reports whether two APL prefixes are identical.
func (a *APLPrefix) equals(b *APLPrefix) bool { func (a *APLPrefix) equals(b *APLPrefix) bool {
return a.Negation == b.Negation && return a.Negation == b.Negation &&
bytes.Equal(a.Network.IP, b.Network.IP) && a.Network.IP.Equal(b.Network.IP) &&
bytes.Equal(a.Network.Mask, b.Network.Mask) bytes.Equal(a.Network.Mask, b.Network.Mask)
} }
@ -1599,21 +1599,19 @@ func euiToString(eui uint64, bits int) (hex string) {
return return
} }
// copyIP returns a copy of ip. // cloneSlice returns a shallow copy of s.
func copyIP(ip net.IP) net.IP { func cloneSlice[E any, S ~[]E](s S) S {
p := make(net.IP, len(ip)) if s == nil {
copy(p, ip) return nil
return p }
return append(S(nil), s...)
} }
// copyNet returns a copy of a subnet. // copyNet returns a copy of a subnet.
func copyNet(n net.IPNet) net.IPNet { func copyNet(n net.IPNet) net.IPNet {
m := make(net.IPMask, len(n.Mask))
copy(m, n.Mask)
return net.IPNet{ return net.IPNet{
IP: copyIP(n.IP), IP: cloneSlice(n.IP),
Mask: m, Mask: cloneSlice(n.Mask),
} }
} }

View file

@ -1,6 +1,9 @@
//go:build windows //go:build windows
// +build windows // +build windows
// TODO(tmthrgd): Remove this Windows-specific code if go.dev/issue/7175 and
// go.dev/issue/7174 are ever fixed.
package dns package dns
import "net" import "net"
@ -15,7 +18,6 @@ func (s *SessionUDP) RemoteAddr() net.Addr { return s.raddr }
// ReadFromSessionUDP acts just like net.UDPConn.ReadFrom(), but returns a session object instead of a // ReadFromSessionUDP acts just like net.UDPConn.ReadFrom(), but returns a session object instead of a
// net.UDPAddr. // net.UDPAddr.
// TODO(fastest963): Once go1.10 is released, use ReadMsgUDP.
func ReadFromSessionUDP(conn *net.UDPConn, b []byte) (int, *SessionUDP, error) { func ReadFromSessionUDP(conn *net.UDPConn, b []byte) (int, *SessionUDP, error) {
n, raddr, err := conn.ReadFrom(b) n, raddr, err := conn.ReadFrom(b)
if err != nil { if err != nil {
@ -25,12 +27,9 @@ func ReadFromSessionUDP(conn *net.UDPConn, b []byte) (int, *SessionUDP, error) {
} }
// WriteToSessionUDP acts just like net.UDPConn.WriteTo(), but uses a *SessionUDP instead of a net.Addr. // WriteToSessionUDP acts just like net.UDPConn.WriteTo(), but uses a *SessionUDP instead of a net.Addr.
// TODO(fastest963): Once go1.10 is released, use WriteMsgUDP.
func WriteToSessionUDP(conn *net.UDPConn, b []byte, session *SessionUDP) (int, error) { func WriteToSessionUDP(conn *net.UDPConn, b []byte, session *SessionUDP) (int, error) {
return conn.WriteTo(b, session.raddr) return conn.WriteTo(b, session.raddr)
} }
// TODO(fastest963): Once go1.10 is released and we can use *MsgUDP methods
// use the standard method in udp.go for these.
func setUDPSocketOptions(*net.UDPConn) error { return nil } func setUDPSocketOptions(*net.UDPConn) error { return nil }
func parseDstFromOOB([]byte, net.IP) net.IP { return nil } func parseDstFromOOB([]byte, net.IP) net.IP { return nil }

View file

@ -3,7 +3,7 @@ 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, 51} var Version = v{1, 1, 52}
// v holds the version of this library. // v holds the version of this library.
type v struct { type v struct {

415
vendor/github.com/miekg/dns/ztypes.go generated vendored
View file

@ -263,6 +263,7 @@ func (rr *A) len(off int, compression map[string]struct{}) int {
} }
return l return l
} }
func (rr *AAAA) len(off int, compression map[string]struct{}) int { func (rr *AAAA) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
if len(rr.AAAA) != 0 { if len(rr.AAAA) != 0 {
@ -270,12 +271,14 @@ func (rr *AAAA) len(off int, compression map[string]struct{}) int {
} }
return l return l
} }
func (rr *AFSDB) len(off int, compression map[string]struct{}) int { func (rr *AFSDB) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // Subtype l += 2 // Subtype
l += domainNameLen(rr.Hostname, off+l, compression, false) l += domainNameLen(rr.Hostname, off+l, compression, false)
return l return l
} }
func (rr *AMTRELAY) len(off int, compression map[string]struct{}) int { func (rr *AMTRELAY) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l++ // Precedence l++ // Precedence
@ -290,10 +293,12 @@ func (rr *AMTRELAY) len(off int, compression map[string]struct{}) int {
} }
return l return l
} }
func (rr *ANY) len(off int, compression map[string]struct{}) int { func (rr *ANY) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
return l return l
} }
func (rr *APL) len(off int, compression map[string]struct{}) int { func (rr *APL) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
for _, x := range rr.Prefixes { for _, x := range rr.Prefixes {
@ -301,6 +306,7 @@ func (rr *APL) len(off int, compression map[string]struct{}) int {
} }
return l return l
} }
func (rr *AVC) len(off int, compression map[string]struct{}) int { func (rr *AVC) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
for _, x := range rr.Txt { for _, x := range rr.Txt {
@ -308,6 +314,7 @@ func (rr *AVC) len(off int, compression map[string]struct{}) int {
} }
return l return l
} }
func (rr *CAA) len(off int, compression map[string]struct{}) int { func (rr *CAA) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l++ // Flag l++ // Flag
@ -315,6 +322,7 @@ func (rr *CAA) len(off int, compression map[string]struct{}) int {
l += len(rr.Value) l += len(rr.Value)
return l return l
} }
func (rr *CERT) len(off int, compression map[string]struct{}) int { func (rr *CERT) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // Type l += 2 // Type
@ -323,21 +331,25 @@ func (rr *CERT) len(off int, compression map[string]struct{}) int {
l += base64.StdEncoding.DecodedLen(len(rr.Certificate)) l += base64.StdEncoding.DecodedLen(len(rr.Certificate))
return l return l
} }
func (rr *CNAME) len(off int, compression map[string]struct{}) int { func (rr *CNAME) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += domainNameLen(rr.Target, off+l, compression, true) l += domainNameLen(rr.Target, off+l, compression, true)
return l return l
} }
func (rr *DHCID) len(off int, compression map[string]struct{}) int { func (rr *DHCID) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += base64.StdEncoding.DecodedLen(len(rr.Digest)) l += base64.StdEncoding.DecodedLen(len(rr.Digest))
return l return l
} }
func (rr *DNAME) len(off int, compression map[string]struct{}) int { func (rr *DNAME) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += domainNameLen(rr.Target, off+l, compression, false) l += domainNameLen(rr.Target, off+l, compression, false)
return l return l
} }
func (rr *DNSKEY) len(off int, compression map[string]struct{}) int { func (rr *DNSKEY) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // Flags l += 2 // Flags
@ -346,6 +358,7 @@ func (rr *DNSKEY) len(off int, compression map[string]struct{}) int {
l += base64.StdEncoding.DecodedLen(len(rr.PublicKey)) l += base64.StdEncoding.DecodedLen(len(rr.PublicKey))
return l return l
} }
func (rr *DS) len(off int, compression map[string]struct{}) int { func (rr *DS) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // KeyTag l += 2 // KeyTag
@ -354,26 +367,31 @@ func (rr *DS) len(off int, compression map[string]struct{}) int {
l += len(rr.Digest) / 2 l += len(rr.Digest) / 2
return l return l
} }
func (rr *EID) len(off int, compression map[string]struct{}) int { func (rr *EID) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += len(rr.Endpoint) / 2 l += len(rr.Endpoint) / 2
return l return l
} }
func (rr *EUI48) len(off int, compression map[string]struct{}) int { func (rr *EUI48) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 6 // Address l += 6 // Address
return l return l
} }
func (rr *EUI64) len(off int, compression map[string]struct{}) int { func (rr *EUI64) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 8 // Address l += 8 // Address
return l return l
} }
func (rr *GID) len(off int, compression map[string]struct{}) int { func (rr *GID) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 4 // Gid l += 4 // Gid
return l return l
} }
func (rr *GPOS) len(off int, compression map[string]struct{}) int { func (rr *GPOS) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += len(rr.Longitude) + 1 l += len(rr.Longitude) + 1
@ -381,12 +399,14 @@ func (rr *GPOS) len(off int, compression map[string]struct{}) int {
l += len(rr.Altitude) + 1 l += len(rr.Altitude) + 1
return l return l
} }
func (rr *HINFO) len(off int, compression map[string]struct{}) int { func (rr *HINFO) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += len(rr.Cpu) + 1 l += len(rr.Cpu) + 1
l += len(rr.Os) + 1 l += len(rr.Os) + 1
return l return l
} }
func (rr *HIP) len(off int, compression map[string]struct{}) int { func (rr *HIP) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l++ // HitLength l++ // HitLength
@ -399,6 +419,7 @@ func (rr *HIP) len(off int, compression map[string]struct{}) int {
} }
return l return l
} }
func (rr *IPSECKEY) len(off int, compression map[string]struct{}) int { func (rr *IPSECKEY) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l++ // Precedence l++ // Precedence
@ -415,12 +436,14 @@ func (rr *IPSECKEY) len(off int, compression map[string]struct{}) int {
l += base64.StdEncoding.DecodedLen(len(rr.PublicKey)) l += base64.StdEncoding.DecodedLen(len(rr.PublicKey))
return l return l
} }
func (rr *KX) len(off int, compression map[string]struct{}) int { func (rr *KX) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // Preference l += 2 // Preference
l += domainNameLen(rr.Exchanger, off+l, compression, false) l += domainNameLen(rr.Exchanger, off+l, compression, false)
return l return l
} }
func (rr *L32) len(off int, compression map[string]struct{}) int { func (rr *L32) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // Preference l += 2 // Preference
@ -429,12 +452,14 @@ func (rr *L32) len(off int, compression map[string]struct{}) int {
} }
return l return l
} }
func (rr *L64) len(off int, compression map[string]struct{}) int { func (rr *L64) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // Preference l += 2 // Preference
l += 8 // Locator64 l += 8 // Locator64
return l return l
} }
func (rr *LOC) len(off int, compression map[string]struct{}) int { func (rr *LOC) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l++ // Version l++ // Version
@ -446,49 +471,58 @@ func (rr *LOC) len(off int, compression map[string]struct{}) int {
l += 4 // Altitude l += 4 // Altitude
return l return l
} }
func (rr *LP) len(off int, compression map[string]struct{}) int { func (rr *LP) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // Preference l += 2 // Preference
l += domainNameLen(rr.Fqdn, off+l, compression, false) l += domainNameLen(rr.Fqdn, off+l, compression, false)
return l return l
} }
func (rr *MB) len(off int, compression map[string]struct{}) int { func (rr *MB) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += domainNameLen(rr.Mb, off+l, compression, true) l += domainNameLen(rr.Mb, off+l, compression, true)
return l return l
} }
func (rr *MD) len(off int, compression map[string]struct{}) int { func (rr *MD) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += domainNameLen(rr.Md, off+l, compression, true) l += domainNameLen(rr.Md, off+l, compression, true)
return l return l
} }
func (rr *MF) len(off int, compression map[string]struct{}) int { func (rr *MF) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += domainNameLen(rr.Mf, off+l, compression, true) l += domainNameLen(rr.Mf, off+l, compression, true)
return l return l
} }
func (rr *MG) len(off int, compression map[string]struct{}) int { func (rr *MG) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += domainNameLen(rr.Mg, off+l, compression, true) l += domainNameLen(rr.Mg, off+l, compression, true)
return l return l
} }
func (rr *MINFO) len(off int, compression map[string]struct{}) int { func (rr *MINFO) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += domainNameLen(rr.Rmail, off+l, compression, true) l += domainNameLen(rr.Rmail, off+l, compression, true)
l += domainNameLen(rr.Email, off+l, compression, true) l += domainNameLen(rr.Email, off+l, compression, true)
return l return l
} }
func (rr *MR) len(off int, compression map[string]struct{}) int { func (rr *MR) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += domainNameLen(rr.Mr, off+l, compression, true) l += domainNameLen(rr.Mr, off+l, compression, true)
return l return l
} }
func (rr *MX) len(off int, compression map[string]struct{}) int { func (rr *MX) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // Preference l += 2 // Preference
l += domainNameLen(rr.Mx, off+l, compression, true) l += domainNameLen(rr.Mx, off+l, compression, true)
return l return l
} }
func (rr *NAPTR) len(off int, compression map[string]struct{}) int { func (rr *NAPTR) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // Order l += 2 // Order
@ -499,17 +533,20 @@ func (rr *NAPTR) len(off int, compression map[string]struct{}) int {
l += domainNameLen(rr.Replacement, off+l, compression, false) l += domainNameLen(rr.Replacement, off+l, compression, false)
return l return l
} }
func (rr *NID) len(off int, compression map[string]struct{}) int { func (rr *NID) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // Preference l += 2 // Preference
l += 8 // NodeID l += 8 // NodeID
return l return l
} }
func (rr *NIMLOC) len(off int, compression map[string]struct{}) int { func (rr *NIMLOC) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += len(rr.Locator) / 2 l += len(rr.Locator) / 2
return l return l
} }
func (rr *NINFO) len(off int, compression map[string]struct{}) int { func (rr *NINFO) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
for _, x := range rr.ZSData { for _, x := range rr.ZSData {
@ -517,16 +554,19 @@ func (rr *NINFO) len(off int, compression map[string]struct{}) int {
} }
return l return l
} }
func (rr *NS) len(off int, compression map[string]struct{}) int { func (rr *NS) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += domainNameLen(rr.Ns, off+l, compression, true) l += domainNameLen(rr.Ns, off+l, compression, true)
return l return l
} }
func (rr *NSAPPTR) len(off int, compression map[string]struct{}) int { func (rr *NSAPPTR) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += domainNameLen(rr.Ptr, off+l, compression, false) l += domainNameLen(rr.Ptr, off+l, compression, false)
return l return l
} }
func (rr *NSEC3PARAM) len(off int, compression map[string]struct{}) int { func (rr *NSEC3PARAM) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l++ // Hash l++ // Hash
@ -536,21 +576,25 @@ func (rr *NSEC3PARAM) len(off int, compression map[string]struct{}) int {
l += len(rr.Salt) / 2 l += len(rr.Salt) / 2
return l return l
} }
func (rr *NULL) len(off int, compression map[string]struct{}) int { func (rr *NULL) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += len(rr.Data) l += len(rr.Data)
return l return l
} }
func (rr *OPENPGPKEY) len(off int, compression map[string]struct{}) int { func (rr *OPENPGPKEY) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += base64.StdEncoding.DecodedLen(len(rr.PublicKey)) l += base64.StdEncoding.DecodedLen(len(rr.PublicKey))
return l return l
} }
func (rr *PTR) len(off int, compression map[string]struct{}) int { func (rr *PTR) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += domainNameLen(rr.Ptr, off+l, compression, true) l += domainNameLen(rr.Ptr, off+l, compression, true)
return l return l
} }
func (rr *PX) len(off int, compression map[string]struct{}) int { func (rr *PX) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // Preference l += 2 // Preference
@ -558,11 +602,13 @@ func (rr *PX) len(off int, compression map[string]struct{}) int {
l += domainNameLen(rr.Mapx400, off+l, compression, false) l += domainNameLen(rr.Mapx400, off+l, compression, false)
return l return l
} }
func (rr *RFC3597) len(off int, compression map[string]struct{}) int { func (rr *RFC3597) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += len(rr.Rdata) / 2 l += len(rr.Rdata) / 2
return l return l
} }
func (rr *RKEY) len(off int, compression map[string]struct{}) int { func (rr *RKEY) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // Flags l += 2 // Flags
@ -571,12 +617,14 @@ func (rr *RKEY) len(off int, compression map[string]struct{}) int {
l += base64.StdEncoding.DecodedLen(len(rr.PublicKey)) l += base64.StdEncoding.DecodedLen(len(rr.PublicKey))
return l return l
} }
func (rr *RP) len(off int, compression map[string]struct{}) int { func (rr *RP) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += domainNameLen(rr.Mbox, off+l, compression, false) l += domainNameLen(rr.Mbox, off+l, compression, false)
l += domainNameLen(rr.Txt, off+l, compression, false) l += domainNameLen(rr.Txt, off+l, compression, false)
return l return l
} }
func (rr *RRSIG) len(off int, compression map[string]struct{}) int { func (rr *RRSIG) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // TypeCovered l += 2 // TypeCovered
@ -590,12 +638,14 @@ func (rr *RRSIG) len(off int, compression map[string]struct{}) int {
l += base64.StdEncoding.DecodedLen(len(rr.Signature)) l += base64.StdEncoding.DecodedLen(len(rr.Signature))
return l return l
} }
func (rr *RT) len(off int, compression map[string]struct{}) int { func (rr *RT) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // Preference l += 2 // Preference
l += domainNameLen(rr.Host, off+l, compression, false) l += domainNameLen(rr.Host, off+l, compression, false)
return l return l
} }
func (rr *SMIMEA) len(off int, compression map[string]struct{}) int { func (rr *SMIMEA) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l++ // Usage l++ // Usage
@ -604,6 +654,7 @@ func (rr *SMIMEA) len(off int, compression map[string]struct{}) int {
l += len(rr.Certificate) / 2 l += len(rr.Certificate) / 2
return l return l
} }
func (rr *SOA) len(off int, compression map[string]struct{}) int { func (rr *SOA) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += domainNameLen(rr.Ns, off+l, compression, true) l += domainNameLen(rr.Ns, off+l, compression, true)
@ -615,6 +666,7 @@ func (rr *SOA) len(off int, compression map[string]struct{}) int {
l += 4 // Minttl l += 4 // Minttl
return l return l
} }
func (rr *SPF) len(off int, compression map[string]struct{}) int { func (rr *SPF) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
for _, x := range rr.Txt { for _, x := range rr.Txt {
@ -622,6 +674,7 @@ func (rr *SPF) len(off int, compression map[string]struct{}) int {
} }
return l return l
} }
func (rr *SRV) len(off int, compression map[string]struct{}) int { func (rr *SRV) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // Priority l += 2 // Priority
@ -630,6 +683,7 @@ func (rr *SRV) len(off int, compression map[string]struct{}) int {
l += domainNameLen(rr.Target, off+l, compression, false) l += domainNameLen(rr.Target, off+l, compression, false)
return l return l
} }
func (rr *SSHFP) len(off int, compression map[string]struct{}) int { func (rr *SSHFP) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l++ // Algorithm l++ // Algorithm
@ -637,6 +691,7 @@ func (rr *SSHFP) len(off int, compression map[string]struct{}) int {
l += len(rr.FingerPrint) / 2 l += len(rr.FingerPrint) / 2
return l return l
} }
func (rr *SVCB) len(off int, compression map[string]struct{}) int { func (rr *SVCB) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // Priority l += 2 // Priority
@ -646,6 +701,7 @@ func (rr *SVCB) len(off int, compression map[string]struct{}) int {
} }
return l return l
} }
func (rr *TA) len(off int, compression map[string]struct{}) int { func (rr *TA) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // KeyTag l += 2 // KeyTag
@ -654,12 +710,14 @@ func (rr *TA) len(off int, compression map[string]struct{}) int {
l += len(rr.Digest) / 2 l += len(rr.Digest) / 2
return l return l
} }
func (rr *TALINK) len(off int, compression map[string]struct{}) int { func (rr *TALINK) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += domainNameLen(rr.PreviousName, off+l, compression, false) l += domainNameLen(rr.PreviousName, off+l, compression, false)
l += domainNameLen(rr.NextName, off+l, compression, false) l += domainNameLen(rr.NextName, off+l, compression, false)
return l return l
} }
func (rr *TKEY) len(off int, compression map[string]struct{}) int { func (rr *TKEY) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += domainNameLen(rr.Algorithm, off+l, compression, false) l += domainNameLen(rr.Algorithm, off+l, compression, false)
@ -673,6 +731,7 @@ func (rr *TKEY) len(off int, compression map[string]struct{}) int {
l += len(rr.OtherData) / 2 l += len(rr.OtherData) / 2
return l return l
} }
func (rr *TLSA) len(off int, compression map[string]struct{}) int { func (rr *TLSA) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l++ // Usage l++ // Usage
@ -681,6 +740,7 @@ func (rr *TLSA) len(off int, compression map[string]struct{}) int {
l += len(rr.Certificate) / 2 l += len(rr.Certificate) / 2
return l return l
} }
func (rr *TSIG) len(off int, compression map[string]struct{}) int { func (rr *TSIG) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += domainNameLen(rr.Algorithm, off+l, compression, false) l += domainNameLen(rr.Algorithm, off+l, compression, false)
@ -694,6 +754,7 @@ func (rr *TSIG) len(off int, compression map[string]struct{}) int {
l += len(rr.OtherData) / 2 l += len(rr.OtherData) / 2
return l return l
} }
func (rr *TXT) len(off int, compression map[string]struct{}) int { func (rr *TXT) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
for _, x := range rr.Txt { for _, x := range rr.Txt {
@ -701,16 +762,19 @@ func (rr *TXT) len(off int, compression map[string]struct{}) int {
} }
return l return l
} }
func (rr *UID) len(off int, compression map[string]struct{}) int { func (rr *UID) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 4 // Uid l += 4 // Uid
return l return l
} }
func (rr *UINFO) len(off int, compression map[string]struct{}) int { func (rr *UINFO) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += len(rr.Uinfo) + 1 l += len(rr.Uinfo) + 1
return l return l
} }
func (rr *URI) len(off int, compression map[string]struct{}) int { func (rr *URI) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 2 // Priority l += 2 // Priority
@ -718,11 +782,13 @@ func (rr *URI) len(off int, compression map[string]struct{}) int {
l += len(rr.Target) l += len(rr.Target)
return l return l
} }
func (rr *X25) len(off int, compression map[string]struct{}) int { func (rr *X25) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += len(rr.PSDNAddress) + 1 l += len(rr.PSDNAddress) + 1
return l return l
} }
func (rr *ZONEMD) len(off int, compression map[string]struct{}) int { func (rr *ZONEMD) len(off int, compression map[string]struct{}) int {
l := rr.Hdr.len(off, compression) l := rr.Hdr.len(off, compression)
l += 4 // Serial l += 4 // Serial
@ -734,20 +800,31 @@ func (rr *ZONEMD) len(off int, compression map[string]struct{}) int {
// copy() functions // copy() functions
func (rr *A) copy() RR { func (rr *A) copy() RR {
return &A{rr.Hdr, copyIP(rr.A)} return &A{rr.Hdr, cloneSlice(rr.A)}
} }
func (rr *AAAA) copy() RR { func (rr *AAAA) copy() RR {
return &AAAA{rr.Hdr, copyIP(rr.AAAA)} return &AAAA{rr.Hdr, cloneSlice(rr.AAAA)}
} }
func (rr *AFSDB) copy() RR { func (rr *AFSDB) copy() RR {
return &AFSDB{rr.Hdr, rr.Subtype, rr.Hostname} return &AFSDB{rr.Hdr, rr.Subtype, rr.Hostname}
} }
func (rr *AMTRELAY) copy() RR { func (rr *AMTRELAY) copy() RR {
return &AMTRELAY{rr.Hdr, rr.Precedence, rr.GatewayType, copyIP(rr.GatewayAddr), rr.GatewayHost} return &AMTRELAY{
rr.Hdr,
rr.Precedence,
rr.GatewayType,
cloneSlice(rr.GatewayAddr),
rr.GatewayHost,
}
} }
func (rr *ANY) copy() RR { func (rr *ANY) copy() RR {
return &ANY{rr.Hdr} return &ANY{rr.Hdr}
} }
func (rr *APL) copy() RR { func (rr *APL) copy() RR {
Prefixes := make([]APLPrefix, len(rr.Prefixes)) Prefixes := make([]APLPrefix, len(rr.Prefixes))
for i, e := range rr.Prefixes { for i, e := range rr.Prefixes {
@ -755,153 +832,270 @@ func (rr *APL) copy() RR {
} }
return &APL{rr.Hdr, Prefixes} return &APL{rr.Hdr, Prefixes}
} }
func (rr *AVC) copy() RR { func (rr *AVC) copy() RR {
Txt := make([]string, len(rr.Txt)) return &AVC{rr.Hdr, cloneSlice(rr.Txt)}
copy(Txt, rr.Txt)
return &AVC{rr.Hdr, Txt}
} }
func (rr *CAA) copy() RR { func (rr *CAA) copy() RR {
return &CAA{rr.Hdr, rr.Flag, rr.Tag, rr.Value} return &CAA{
rr.Hdr,
rr.Flag,
rr.Tag,
rr.Value,
}
} }
func (rr *CDNSKEY) copy() RR { func (rr *CDNSKEY) copy() RR {
return &CDNSKEY{*rr.DNSKEY.copy().(*DNSKEY)} return &CDNSKEY{*rr.DNSKEY.copy().(*DNSKEY)}
} }
func (rr *CDS) copy() RR { func (rr *CDS) copy() RR {
return &CDS{*rr.DS.copy().(*DS)} return &CDS{*rr.DS.copy().(*DS)}
} }
func (rr *CERT) copy() RR { func (rr *CERT) copy() RR {
return &CERT{rr.Hdr, rr.Type, rr.KeyTag, rr.Algorithm, rr.Certificate} return &CERT{
rr.Hdr,
rr.Type,
rr.KeyTag,
rr.Algorithm,
rr.Certificate,
}
} }
func (rr *CNAME) copy() RR { func (rr *CNAME) copy() RR {
return &CNAME{rr.Hdr, rr.Target} return &CNAME{rr.Hdr, rr.Target}
} }
func (rr *CSYNC) copy() RR { func (rr *CSYNC) copy() RR {
TypeBitMap := make([]uint16, len(rr.TypeBitMap)) return &CSYNC{
copy(TypeBitMap, rr.TypeBitMap) rr.Hdr,
return &CSYNC{rr.Hdr, rr.Serial, rr.Flags, TypeBitMap} rr.Serial,
rr.Flags,
cloneSlice(rr.TypeBitMap),
}
} }
func (rr *DHCID) copy() RR { func (rr *DHCID) copy() RR {
return &DHCID{rr.Hdr, rr.Digest} return &DHCID{rr.Hdr, rr.Digest}
} }
func (rr *DLV) copy() RR { func (rr *DLV) copy() RR {
return &DLV{*rr.DS.copy().(*DS)} return &DLV{*rr.DS.copy().(*DS)}
} }
func (rr *DNAME) copy() RR { func (rr *DNAME) copy() RR {
return &DNAME{rr.Hdr, rr.Target} return &DNAME{rr.Hdr, rr.Target}
} }
func (rr *DNSKEY) copy() RR { func (rr *DNSKEY) copy() RR {
return &DNSKEY{rr.Hdr, rr.Flags, rr.Protocol, rr.Algorithm, rr.PublicKey} return &DNSKEY{
rr.Hdr,
rr.Flags,
rr.Protocol,
rr.Algorithm,
rr.PublicKey,
}
} }
func (rr *DS) copy() RR { func (rr *DS) copy() RR {
return &DS{rr.Hdr, rr.KeyTag, rr.Algorithm, rr.DigestType, rr.Digest} return &DS{
rr.Hdr,
rr.KeyTag,
rr.Algorithm,
rr.DigestType,
rr.Digest,
}
} }
func (rr *EID) copy() RR { func (rr *EID) copy() RR {
return &EID{rr.Hdr, rr.Endpoint} return &EID{rr.Hdr, rr.Endpoint}
} }
func (rr *EUI48) copy() RR { func (rr *EUI48) copy() RR {
return &EUI48{rr.Hdr, rr.Address} return &EUI48{rr.Hdr, rr.Address}
} }
func (rr *EUI64) copy() RR { func (rr *EUI64) copy() RR {
return &EUI64{rr.Hdr, rr.Address} return &EUI64{rr.Hdr, rr.Address}
} }
func (rr *GID) copy() RR { func (rr *GID) copy() RR {
return &GID{rr.Hdr, rr.Gid} return &GID{rr.Hdr, rr.Gid}
} }
func (rr *GPOS) copy() RR { func (rr *GPOS) copy() RR {
return &GPOS{rr.Hdr, rr.Longitude, rr.Latitude, rr.Altitude} return &GPOS{
rr.Hdr,
rr.Longitude,
rr.Latitude,
rr.Altitude,
}
} }
func (rr *HINFO) copy() RR { func (rr *HINFO) copy() RR {
return &HINFO{rr.Hdr, rr.Cpu, rr.Os} return &HINFO{rr.Hdr, rr.Cpu, rr.Os}
} }
func (rr *HIP) copy() RR { func (rr *HIP) copy() RR {
RendezvousServers := make([]string, len(rr.RendezvousServers)) return &HIP{
copy(RendezvousServers, rr.RendezvousServers) rr.Hdr,
return &HIP{rr.Hdr, rr.HitLength, rr.PublicKeyAlgorithm, rr.PublicKeyLength, rr.Hit, rr.PublicKey, RendezvousServers} rr.HitLength,
rr.PublicKeyAlgorithm,
rr.PublicKeyLength,
rr.Hit,
rr.PublicKey,
cloneSlice(rr.RendezvousServers),
}
} }
func (rr *HTTPS) copy() RR { func (rr *HTTPS) copy() RR {
return &HTTPS{*rr.SVCB.copy().(*SVCB)} return &HTTPS{*rr.SVCB.copy().(*SVCB)}
} }
func (rr *IPSECKEY) copy() RR { func (rr *IPSECKEY) copy() RR {
return &IPSECKEY{rr.Hdr, rr.Precedence, rr.GatewayType, rr.Algorithm, copyIP(rr.GatewayAddr), rr.GatewayHost, rr.PublicKey} return &IPSECKEY{
rr.Hdr,
rr.Precedence,
rr.GatewayType,
rr.Algorithm,
cloneSlice(rr.GatewayAddr),
rr.GatewayHost,
rr.PublicKey,
}
} }
func (rr *KEY) copy() RR { func (rr *KEY) copy() RR {
return &KEY{*rr.DNSKEY.copy().(*DNSKEY)} return &KEY{*rr.DNSKEY.copy().(*DNSKEY)}
} }
func (rr *KX) copy() RR { func (rr *KX) copy() RR {
return &KX{rr.Hdr, rr.Preference, rr.Exchanger} return &KX{rr.Hdr, rr.Preference, rr.Exchanger}
} }
func (rr *L32) copy() RR { func (rr *L32) copy() RR {
return &L32{rr.Hdr, rr.Preference, copyIP(rr.Locator32)} return &L32{rr.Hdr, rr.Preference, cloneSlice(rr.Locator32)}
} }
func (rr *L64) copy() RR { func (rr *L64) copy() RR {
return &L64{rr.Hdr, rr.Preference, rr.Locator64} return &L64{rr.Hdr, rr.Preference, rr.Locator64}
} }
func (rr *LOC) copy() RR { func (rr *LOC) copy() RR {
return &LOC{rr.Hdr, rr.Version, rr.Size, rr.HorizPre, rr.VertPre, rr.Latitude, rr.Longitude, rr.Altitude} return &LOC{
rr.Hdr,
rr.Version,
rr.Size,
rr.HorizPre,
rr.VertPre,
rr.Latitude,
rr.Longitude,
rr.Altitude,
}
} }
func (rr *LP) copy() RR { func (rr *LP) copy() RR {
return &LP{rr.Hdr, rr.Preference, rr.Fqdn} return &LP{rr.Hdr, rr.Preference, rr.Fqdn}
} }
func (rr *MB) copy() RR { func (rr *MB) copy() RR {
return &MB{rr.Hdr, rr.Mb} return &MB{rr.Hdr, rr.Mb}
} }
func (rr *MD) copy() RR { func (rr *MD) copy() RR {
return &MD{rr.Hdr, rr.Md} return &MD{rr.Hdr, rr.Md}
} }
func (rr *MF) copy() RR { func (rr *MF) copy() RR {
return &MF{rr.Hdr, rr.Mf} return &MF{rr.Hdr, rr.Mf}
} }
func (rr *MG) copy() RR { func (rr *MG) copy() RR {
return &MG{rr.Hdr, rr.Mg} return &MG{rr.Hdr, rr.Mg}
} }
func (rr *MINFO) copy() RR { func (rr *MINFO) copy() RR {
return &MINFO{rr.Hdr, rr.Rmail, rr.Email} return &MINFO{rr.Hdr, rr.Rmail, rr.Email}
} }
func (rr *MR) copy() RR { func (rr *MR) copy() RR {
return &MR{rr.Hdr, rr.Mr} return &MR{rr.Hdr, rr.Mr}
} }
func (rr *MX) copy() RR { func (rr *MX) copy() RR {
return &MX{rr.Hdr, rr.Preference, rr.Mx} return &MX{rr.Hdr, rr.Preference, rr.Mx}
} }
func (rr *NAPTR) copy() RR { func (rr *NAPTR) copy() RR {
return &NAPTR{rr.Hdr, rr.Order, rr.Preference, rr.Flags, rr.Service, rr.Regexp, rr.Replacement} return &NAPTR{
rr.Hdr,
rr.Order,
rr.Preference,
rr.Flags,
rr.Service,
rr.Regexp,
rr.Replacement,
}
} }
func (rr *NID) copy() RR { func (rr *NID) copy() RR {
return &NID{rr.Hdr, rr.Preference, rr.NodeID} return &NID{rr.Hdr, rr.Preference, rr.NodeID}
} }
func (rr *NIMLOC) copy() RR { func (rr *NIMLOC) copy() RR {
return &NIMLOC{rr.Hdr, rr.Locator} return &NIMLOC{rr.Hdr, rr.Locator}
} }
func (rr *NINFO) copy() RR { func (rr *NINFO) copy() RR {
ZSData := make([]string, len(rr.ZSData)) return &NINFO{rr.Hdr, cloneSlice(rr.ZSData)}
copy(ZSData, rr.ZSData)
return &NINFO{rr.Hdr, ZSData}
} }
func (rr *NS) copy() RR { func (rr *NS) copy() RR {
return &NS{rr.Hdr, rr.Ns} return &NS{rr.Hdr, rr.Ns}
} }
func (rr *NSAPPTR) copy() RR { func (rr *NSAPPTR) copy() RR {
return &NSAPPTR{rr.Hdr, rr.Ptr} return &NSAPPTR{rr.Hdr, rr.Ptr}
} }
func (rr *NSEC) copy() RR { func (rr *NSEC) copy() RR {
TypeBitMap := make([]uint16, len(rr.TypeBitMap)) return &NSEC{rr.Hdr, rr.NextDomain, cloneSlice(rr.TypeBitMap)}
copy(TypeBitMap, rr.TypeBitMap)
return &NSEC{rr.Hdr, rr.NextDomain, TypeBitMap}
} }
func (rr *NSEC3) copy() RR { func (rr *NSEC3) copy() RR {
TypeBitMap := make([]uint16, len(rr.TypeBitMap)) return &NSEC3{
copy(TypeBitMap, rr.TypeBitMap) rr.Hdr,
return &NSEC3{rr.Hdr, rr.Hash, rr.Flags, rr.Iterations, rr.SaltLength, rr.Salt, rr.HashLength, rr.NextDomain, TypeBitMap} rr.Hash,
rr.Flags,
rr.Iterations,
rr.SaltLength,
rr.Salt,
rr.HashLength,
rr.NextDomain,
cloneSlice(rr.TypeBitMap),
}
} }
func (rr *NSEC3PARAM) copy() RR { func (rr *NSEC3PARAM) copy() RR {
return &NSEC3PARAM{rr.Hdr, rr.Hash, rr.Flags, rr.Iterations, rr.SaltLength, rr.Salt} return &NSEC3PARAM{
rr.Hdr,
rr.Hash,
rr.Flags,
rr.Iterations,
rr.SaltLength,
rr.Salt,
}
} }
func (rr *NULL) copy() RR { func (rr *NULL) copy() RR {
return &NULL{rr.Hdr, rr.Data} return &NULL{rr.Hdr, rr.Data}
} }
func (rr *OPENPGPKEY) copy() RR { func (rr *OPENPGPKEY) copy() RR {
return &OPENPGPKEY{rr.Hdr, rr.PublicKey} return &OPENPGPKEY{rr.Hdr, rr.PublicKey}
} }
func (rr *OPT) copy() RR { func (rr *OPT) copy() RR {
Option := make([]EDNS0, len(rr.Option)) Option := make([]EDNS0, len(rr.Option))
for i, e := range rr.Option { for i, e := range rr.Option {
@ -909,86 +1103,205 @@ func (rr *OPT) copy() RR {
} }
return &OPT{rr.Hdr, Option} return &OPT{rr.Hdr, Option}
} }
func (rr *PTR) copy() RR { func (rr *PTR) copy() RR {
return &PTR{rr.Hdr, rr.Ptr} return &PTR{rr.Hdr, rr.Ptr}
} }
func (rr *PX) copy() RR { func (rr *PX) copy() RR {
return &PX{rr.Hdr, rr.Preference, rr.Map822, rr.Mapx400} return &PX{
rr.Hdr,
rr.Preference,
rr.Map822,
rr.Mapx400,
}
} }
func (rr *RFC3597) copy() RR { func (rr *RFC3597) copy() RR {
return &RFC3597{rr.Hdr, rr.Rdata} return &RFC3597{rr.Hdr, rr.Rdata}
} }
func (rr *RKEY) copy() RR { func (rr *RKEY) copy() RR {
return &RKEY{rr.Hdr, rr.Flags, rr.Protocol, rr.Algorithm, rr.PublicKey} return &RKEY{
rr.Hdr,
rr.Flags,
rr.Protocol,
rr.Algorithm,
rr.PublicKey,
}
} }
func (rr *RP) copy() RR { func (rr *RP) copy() RR {
return &RP{rr.Hdr, rr.Mbox, rr.Txt} return &RP{rr.Hdr, rr.Mbox, rr.Txt}
} }
func (rr *RRSIG) copy() RR { func (rr *RRSIG) copy() RR {
return &RRSIG{rr.Hdr, rr.TypeCovered, rr.Algorithm, rr.Labels, rr.OrigTtl, rr.Expiration, rr.Inception, rr.KeyTag, rr.SignerName, rr.Signature} return &RRSIG{
rr.Hdr,
rr.TypeCovered,
rr.Algorithm,
rr.Labels,
rr.OrigTtl,
rr.Expiration,
rr.Inception,
rr.KeyTag,
rr.SignerName,
rr.Signature,
}
} }
func (rr *RT) copy() RR { func (rr *RT) copy() RR {
return &RT{rr.Hdr, rr.Preference, rr.Host} return &RT{rr.Hdr, rr.Preference, rr.Host}
} }
func (rr *SIG) copy() RR { func (rr *SIG) copy() RR {
return &SIG{*rr.RRSIG.copy().(*RRSIG)} return &SIG{*rr.RRSIG.copy().(*RRSIG)}
} }
func (rr *SMIMEA) copy() RR { func (rr *SMIMEA) copy() RR {
return &SMIMEA{rr.Hdr, rr.Usage, rr.Selector, rr.MatchingType, rr.Certificate} return &SMIMEA{
rr.Hdr,
rr.Usage,
rr.Selector,
rr.MatchingType,
rr.Certificate,
}
} }
func (rr *SOA) copy() RR { func (rr *SOA) copy() RR {
return &SOA{rr.Hdr, rr.Ns, rr.Mbox, rr.Serial, rr.Refresh, rr.Retry, rr.Expire, rr.Minttl} return &SOA{
rr.Hdr,
rr.Ns,
rr.Mbox,
rr.Serial,
rr.Refresh,
rr.Retry,
rr.Expire,
rr.Minttl,
}
} }
func (rr *SPF) copy() RR { func (rr *SPF) copy() RR {
Txt := make([]string, len(rr.Txt)) return &SPF{rr.Hdr, cloneSlice(rr.Txt)}
copy(Txt, rr.Txt)
return &SPF{rr.Hdr, Txt}
} }
func (rr *SRV) copy() RR { func (rr *SRV) copy() RR {
return &SRV{rr.Hdr, rr.Priority, rr.Weight, rr.Port, rr.Target} return &SRV{
rr.Hdr,
rr.Priority,
rr.Weight,
rr.Port,
rr.Target,
}
} }
func (rr *SSHFP) copy() RR { func (rr *SSHFP) copy() RR {
return &SSHFP{rr.Hdr, rr.Algorithm, rr.Type, rr.FingerPrint} return &SSHFP{
rr.Hdr,
rr.Algorithm,
rr.Type,
rr.FingerPrint,
}
} }
func (rr *SVCB) copy() RR { func (rr *SVCB) copy() RR {
Value := make([]SVCBKeyValue, len(rr.Value)) Value := make([]SVCBKeyValue, len(rr.Value))
for i, e := range rr.Value { for i, e := range rr.Value {
Value[i] = e.copy() Value[i] = e.copy()
} }
return &SVCB{rr.Hdr, rr.Priority, rr.Target, Value} return &SVCB{
rr.Hdr,
rr.Priority,
rr.Target,
Value,
}
} }
func (rr *TA) copy() RR { func (rr *TA) copy() RR {
return &TA{rr.Hdr, rr.KeyTag, rr.Algorithm, rr.DigestType, rr.Digest} return &TA{
rr.Hdr,
rr.KeyTag,
rr.Algorithm,
rr.DigestType,
rr.Digest,
}
} }
func (rr *TALINK) copy() RR { func (rr *TALINK) copy() RR {
return &TALINK{rr.Hdr, rr.PreviousName, rr.NextName} return &TALINK{rr.Hdr, rr.PreviousName, rr.NextName}
} }
func (rr *TKEY) copy() RR { func (rr *TKEY) copy() RR {
return &TKEY{rr.Hdr, rr.Algorithm, rr.Inception, rr.Expiration, rr.Mode, rr.Error, rr.KeySize, rr.Key, rr.OtherLen, rr.OtherData} return &TKEY{
rr.Hdr,
rr.Algorithm,
rr.Inception,
rr.Expiration,
rr.Mode,
rr.Error,
rr.KeySize,
rr.Key,
rr.OtherLen,
rr.OtherData,
}
} }
func (rr *TLSA) copy() RR { func (rr *TLSA) copy() RR {
return &TLSA{rr.Hdr, rr.Usage, rr.Selector, rr.MatchingType, rr.Certificate} return &TLSA{
rr.Hdr,
rr.Usage,
rr.Selector,
rr.MatchingType,
rr.Certificate,
}
} }
func (rr *TSIG) copy() RR { func (rr *TSIG) copy() RR {
return &TSIG{rr.Hdr, rr.Algorithm, rr.TimeSigned, rr.Fudge, rr.MACSize, rr.MAC, rr.OrigId, rr.Error, rr.OtherLen, rr.OtherData} return &TSIG{
rr.Hdr,
rr.Algorithm,
rr.TimeSigned,
rr.Fudge,
rr.MACSize,
rr.MAC,
rr.OrigId,
rr.Error,
rr.OtherLen,
rr.OtherData,
}
} }
func (rr *TXT) copy() RR { func (rr *TXT) copy() RR {
Txt := make([]string, len(rr.Txt)) return &TXT{rr.Hdr, cloneSlice(rr.Txt)}
copy(Txt, rr.Txt)
return &TXT{rr.Hdr, Txt}
} }
func (rr *UID) copy() RR { func (rr *UID) copy() RR {
return &UID{rr.Hdr, rr.Uid} return &UID{rr.Hdr, rr.Uid}
} }
func (rr *UINFO) copy() RR { func (rr *UINFO) copy() RR {
return &UINFO{rr.Hdr, rr.Uinfo} return &UINFO{rr.Hdr, rr.Uinfo}
} }
func (rr *URI) copy() RR { func (rr *URI) copy() RR {
return &URI{rr.Hdr, rr.Priority, rr.Weight, rr.Target} return &URI{
rr.Hdr,
rr.Priority,
rr.Weight,
rr.Target,
}
} }
func (rr *X25) copy() RR { func (rr *X25) copy() RR {
return &X25{rr.Hdr, rr.PSDNAddress} return &X25{rr.Hdr, rr.PSDNAddress}
} }
func (rr *ZONEMD) copy() RR { func (rr *ZONEMD) copy() RR {
return &ZONEMD{rr.Hdr, rr.Serial, rr.Scheme, rr.Hash, rr.Digest} return &ZONEMD{
rr.Hdr,
rr.Serial,
rr.Scheme,
rr.Hash,
rr.Digest,
}
} }

4
vendor/modules.txt vendored
View file

@ -350,8 +350,8 @@ github.com/mattn/go-isatty
## explicit; go 1.19 ## explicit; go 1.19
github.com/microcosm-cc/bluemonday github.com/microcosm-cc/bluemonday
github.com/microcosm-cc/bluemonday/css github.com/microcosm-cc/bluemonday/css
# github.com/miekg/dns v1.1.51 # github.com/miekg/dns v1.1.52
## explicit; go 1.14 ## explicit; go 1.19
github.com/miekg/dns github.com/miekg/dns
# github.com/minio/md5-simd v1.1.2 # github.com/minio/md5-simd v1.1.2
## explicit; go 1.14 ## explicit; go 1.14