From 8e5f514d92d203cbea5c9367b04cba170acee75e Mon Sep 17 00:00:00 2001 From: evilsocket Date: Thu, 8 Feb 2018 06:03:16 +0100 Subject: [PATCH] balls --- session/targets.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/session/targets.go b/session/targets.go index cff70a26..49a6fa51 100644 --- a/session/targets.go +++ b/session/targets.go @@ -138,8 +138,21 @@ func (tp *Targets) Remove(ip, mac string) { } func (tp *Targets) shouldIgnore(ip string) bool { + // skip our own address + if ip == tp.Interface.IpAddress { + return true + } + // skip the gateway + if ip == tp.Gateway.IpAddress { + return true + } + // skip broadcast addresses + if strings.HasSuffix(ip, ".255") { + return true + } + // skip everything which is not in our subnet (multicast noise) addr := net.ParseIP(ip) - return (ip == tp.Interface.IpAddress || ip == tp.Gateway.IpAddress || tp.Session.Interface.Net.Contains(addr) == false) + return tp.Session.Interface.Net.Contains(addr) == false } func (tp *Targets) Has(ip string) bool {