From fcbcdaf9acc9cb88797027da267dfc14140b1ea9 Mon Sep 17 00:00:00 2001 From: maride Date: Thu, 28 Nov 2019 18:22:19 +0100 Subject: [PATCH] Avoid false 'ARP Spoofing' detection --- ethernet/arp/arp.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ethernet/arp/arp.go b/ethernet/arp/arp.go index ebbc05d..0bd7c52 100644 --- a/ethernet/arp/arp.go +++ b/ethernet/arp/arp.go @@ -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) 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++ { // check if we found a collision (possible ARP spoofing) if (devices[i].macaddr == macaddr) != (devices[i].ipaddr == ipaddr) {