From 5916866ebb9366dcc26e8d6ad560bc7cb1f5448e Mon Sep 17 00:00:00 2001 From: marko Date: Sat, 5 Oct 2024 12:34:47 +0200 Subject: [PATCH] removed pinging of router and localIp --- ping/ping.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ping/ping.go b/ping/ping.go index e460ba4..29771ad 100644 --- a/ping/ping.go +++ b/ping/ping.go @@ -21,12 +21,16 @@ func PingLocal255() int { deviceCount := 0 mu := &sync.Mutex{} - for i := 1; i < 255; i++ { + for i := 2; i < 255; i++ { wg.Add(1) go func(i int) { defer wg.Done() addr := fmt.Sprintf("%s.%d", network[:len(network)-2], i) + if addr == localIP.String() { + return + } + if ping(addr) { mu.Lock() deviceCount++