Просмотр исходного кода

Log "too few or too many" questions.

This log line would formerly be emitted for a query with 0 questions:
	FORMERR: too many questions (0)

The Nmap DNSStatusRequest probe is a query with 0 questions.
David Fifield 5 лет назад
Родитель
Сommit
a6602a871b
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      dnstt-server/main.go

+ 1 - 1
dnstt-server/main.go

@@ -406,7 +406,7 @@ func responseFor(query *dns.Message, domain dns.Name) (*dns.Message, []byte) {
 	// There must be exactly one question.
 	// There must be exactly one question.
 	if len(query.Question) != 1 {
 	if len(query.Question) != 1 {
 		resp.Flags |= dns.RcodeFormatError
 		resp.Flags |= dns.RcodeFormatError
-		log.Printf("FORMERR: too many questions (%d)", len(query.Question))
+		log.Printf("FORMERR: too few or too many questions (%d)", len(query.Question))
 		return resp, nil
 		return resp, nil
 	}
 	}
 	question := query.Question[0]
 	question := query.Question[0]