Этот коммит содержится в:
Christopher Speller
2019-07-29 07:39:56 -07:00
коммит произвёл GitHub
родитель f226f672f3
Коммит 20825a1702
547 изменённых файлов: 44126 добавлений и 27501 удалений

6
vendor/github.com/miekg/dns/format.go сгенерированный поставляемый
Просмотреть файл

@@ -31,6 +31,9 @@ func Field(r RR, i int) string {
switch reflect.ValueOf(r).Elem().Type().Field(i).Tag {
case `dns:"a"`:
// TODO(miek): Hmm store this as 16 bytes
if d.Len() < net.IPv4len {
return ""
}
if d.Len() < net.IPv6len {
return net.IPv4(byte(d.Index(0).Uint()),
byte(d.Index(1).Uint()),
@@ -42,6 +45,9 @@ func Field(r RR, i int) string {
byte(d.Index(14).Uint()),
byte(d.Index(15).Uint())).String()
case `dns:"aaaa"`:
if d.Len() < net.IPv6len {
return ""
}
return net.IP{
byte(d.Index(0).Uint()),
byte(d.Index(1).Uint()),