mirror of
https://github.com/maride/pancap.git
synced 2024-11-22 16:54:25 +00:00
Avoid false 'ARP Spoofing' detection
This commit is contained in:
parent
37afbb58a9
commit
fcbcdaf9ac
@ -105,6 +105,11 @@ func getStatOrCreate(macaddr string) *arpStats {
|
|||||||
|
|
||||||
// Adds a new entry to the devices array, checking if there may be a collision (=ARP Spoofing)
|
// Adds a new entry to the devices array, checking if there may be a collision (=ARP Spoofing)
|
||||||
func addDeviceEntry(macaddr string, ipaddr string) {
|
func addDeviceEntry(macaddr string, ipaddr string) {
|
||||||
|
if ipaddr == "0.0.0.0" {
|
||||||
|
// Possible ARP request if sender doesn't have an IP address yet. Ignore.
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
for i := 0; i < len(devices); i++ {
|
for i := 0; i < len(devices); i++ {
|
||||||
// check if we found a collision (possible ARP spoofing)
|
// check if we found a collision (possible ARP spoofing)
|
||||||
if (devices[i].macaddr == macaddr) != (devices[i].ipaddr == ipaddr) {
|
if (devices[i].macaddr == macaddr) != (devices[i].ipaddr == ipaddr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user