@@ -327,7 +327,7 @@ func (r *Resolver) filterNameServersForUniqueNames(nameServers []NameServer) []N
327
327
}
328
328
}
329
329
if ipv4NS == nil && ipv6NS == nil {
330
- // can be the case that nameservers don't have IPs (like if we have an authority but no additionals )
330
+ // can be the case that nameservers don't have IPs (like if we have an authority but no additional )
331
331
// use the first NS if so
332
332
if len (nsSlice ) > 0 {
333
333
filteredNameServersSet = append (filteredNameServersSet , nsSlice [0 ])
@@ -472,7 +472,7 @@ func (r *Resolver) extractNameServersFromLayerResults(layerResults []ExtendedRes
472
472
if res .Status != StatusNoError {
473
473
continue
474
474
}
475
- for _ , ans := range res .Res .Additional {
475
+ for _ , ans := range res .Res .Additionals {
476
476
if a , ok := ans .(Answer ); ok {
477
477
uniqueAdditionals [mapKey {Type : a .RrType , Name : a .Name , Answer : a .Answer }] = a
478
478
}
@@ -695,16 +695,16 @@ func (r *Resolver) iterativeLookup(ctx context.Context, qWithMeta *QuestionWithM
695
695
r .verboseLog ((depth + 1 ), "-> error occurred during lookup" )
696
696
return result , trace , status , err
697
697
} else if len (result .Answers ) != 0 || result .Flags .Authoritative {
698
- // DS records is authoritative from parent NS and will be in Authority section. Avoid dropping them.
698
+ // DS records are authoritative from parent NS and will be in Authority section. Avoid dropping them.
699
699
if len (result .Answers ) != 0 && qWithMeta .Q .Type != dns .TypeDS {
700
700
r .verboseLog ((depth + 1 ), "-> answers found" )
701
701
if len (result .Authorities ) > 0 {
702
702
r .verboseLog ((depth + 2 ), "Dropping " , len (result .Authorities ), " authority answers from output" )
703
703
result .Authorities = make ([]interface {}, 0 )
704
704
}
705
- if len (result .Additional ) > 0 {
706
- r .verboseLog ((depth + 2 ), "Dropping " , len (result .Additional ), " additional answers from output" )
707
- result .Additional = make ([]interface {}, 0 )
705
+ if len (result .Additionals ) > 0 {
706
+ r .verboseLog ((depth + 2 ), "Dropping " , len (result .Additionals ), " additional answers from output" )
707
+ result .Additionals = make ([]interface {}, 0 )
708
708
}
709
709
} else {
710
710
r .verboseLog ((depth + 1 ), "-> authoritative response found" )
@@ -868,7 +868,7 @@ func (r *Resolver) cachedLookup(ctx context.Context, q Question, nameServer *Nam
868
868
if ok {
869
869
r .verboseLog (depth + 2 , "Cache auth hit for " , authName )
870
870
// only want to return if we actually have additionals and authorities from the cache for the caller
871
- if len (cachedResult .Additional ) > 0 && len (cachedResult .Authorities ) > 0 {
871
+ if len (cachedResult .Additionals ) > 0 && len (cachedResult .Authorities ) > 0 {
872
872
return cachedResult , true , StatusNoError , trace , nil
873
873
}
874
874
// unsuccessful in retrieving from the cache, we'll continue to the wire
@@ -1010,7 +1010,7 @@ func doDoTLookup(ctx context.Context, connInfo *ConnectionInfo, q Question, name
1010
1010
Protocol : DoTProtocol ,
1011
1011
Answers : []interface {}{},
1012
1012
Authorities : []interface {}{},
1013
- Additional : []interface {}{},
1013
+ Additionals : []interface {}{},
1014
1014
}
1015
1015
// if we have it, add the TLS handshake info
1016
1016
if connInfo .tlsHandshake != nil {
@@ -1082,7 +1082,7 @@ func doDoHLookup(ctx context.Context, httpClient *http.Client, q Question, nameS
1082
1082
Protocol : DoHProtocol ,
1083
1083
Answers : []interface {}{},
1084
1084
Authorities : []interface {}{},
1085
- Additional : []interface {}{},
1085
+ Additionals : []interface {}{},
1086
1086
}
1087
1087
if resp .Request != nil && resp .Request .TLSLog != nil {
1088
1088
processor := output.Processor {Verbose : false }
@@ -1098,7 +1098,7 @@ func doDoHLookup(ctx context.Context, httpClient *http.Client, q Question, nameS
1098
1098
1099
1099
// wireLookupTCP performs a DNS lookup on-the-wire over TCP with the given parameters
1100
1100
func wireLookupTCP (ctx context.Context , connInfo * ConnectionInfo , q Question , nameServer * NameServer , ednsOptions []dns.EDNS0 , recursive , dnssec , checkingDisabled bool ) (* SingleQueryResult , * dns.Msg , Status , error ) {
1101
- res := SingleQueryResult {Answers : []interface {}{}, Authorities : []interface {}{}, Additional : []interface {}{}}
1101
+ res := SingleQueryResult {Answers : []interface {}{}, Authorities : []interface {}{}, Additionals : []interface {}{}}
1102
1102
res .Resolver = nameServer .String ()
1103
1103
1104
1104
m := new (dns.Msg )
@@ -1152,7 +1152,7 @@ func wireLookupTCP(ctx context.Context, connInfo *ConnectionInfo, q Question, na
1152
1152
1153
1153
// wireLookupUDP performs a DNS lookup on-the-wire over UDP with the given parameters
1154
1154
func wireLookupUDP (ctx context.Context , connInfo * ConnectionInfo , q Question , nameServer * NameServer , ednsOptions []dns.EDNS0 , recursive , dnssec , checkingDisabled bool ) (* SingleQueryResult , * dns.Msg , Status , error ) {
1155
- res := SingleQueryResult {Answers : []interface {}{}, Authorities : []interface {}{}, Additional : []interface {}{}}
1155
+ res := SingleQueryResult {Answers : []interface {}{}, Authorities : []interface {}{}, Additionals : []interface {}{}}
1156
1156
res .Resolver = nameServer .String ()
1157
1157
res .Protocol = "udp"
1158
1158
@@ -1196,7 +1196,7 @@ func constructSingleQueryResultFromDNSMsg(res *SingleQueryResult, r *dns.Msg) (*
1196
1196
for _ , ans := range r .Extra {
1197
1197
inner := ParseAnswer (ans )
1198
1198
if inner != nil {
1199
- res .Additional = append (res .Additional , inner )
1199
+ res .Additionals = append (res .Additionals , inner )
1200
1200
}
1201
1201
}
1202
1202
return res , r , TranslateDNSErrorCode (r .Rcode ), nil
@@ -1221,7 +1221,7 @@ func constructSingleQueryResultFromDNSMsg(res *SingleQueryResult, r *dns.Msg) (*
1221
1221
for _ , ans := range r .Extra {
1222
1222
inner := ParseAnswer (ans )
1223
1223
if inner != nil {
1224
- res .Additional = append (res .Additional , inner )
1224
+ res .Additionals = append (res .Additionals , inner )
1225
1225
}
1226
1226
}
1227
1227
for _ , ans := range r .Ns {
0 commit comments