mirror of
https://github.com/maride/pancap.git
synced 2024-11-22 08:54:24 +00:00
Check for doubles before adding IP addresses to DNS answer list
This commit is contained in:
parent
ad532a5a22
commit
a368f18915
@ -54,9 +54,9 @@ func processDNSAnswer(answers []layers.DNSResourceRecord) {
|
|||||||
if answer.Type == layers.DNSTypeA {
|
if answer.Type == layers.DNSTypeA {
|
||||||
// A record, check IP for being private
|
// A record, check IP for being private
|
||||||
if ipIsPrivate(answer.IP) {
|
if ipIsPrivate(answer.IP) {
|
||||||
answerPrivateIPv4 = append(answerPrivateIPv4, answer.IP.String())
|
answerPrivateIPv4 = common.AppendIfUnique(answer.IP.String(), answerPrivateIPv4)
|
||||||
} else {
|
} else {
|
||||||
answerPublicIPv4 = append(answerPublicIPv4, answer.IP.String())
|
answerPublicIPv4 = common.AppendIfUnique(answer.IP.String(), answerPublicIPv4)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user