Check for doubles before adding IP addresses to DNS answer list

This commit is contained in:
maride 2019-12-03 18:14:49 +01:00
parent ad532a5a22
commit a368f18915

View File

@ -54,9 +54,9 @@ func processDNSAnswer(answers []layers.DNSResourceRecord) {
if answer.Type == layers.DNSTypeA {
// A record, check IP for being private
if ipIsPrivate(answer.IP) {
answerPrivateIPv4 = append(answerPrivateIPv4, answer.IP.String())
answerPrivateIPv4 = common.AppendIfUnique(answer.IP.String(), answerPrivateIPv4)
} else {
answerPublicIPv4 = append(answerPublicIPv4, answer.IP.String())
answerPublicIPv4 = common.AppendIfUnique(answer.IP.String(), answerPublicIPv4)
}
}
}