removed pinging of router and localIp
This commit is contained in:
parent
12f28a6623
commit
5916866ebb
@ -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++
|
||||
|
Loading…
Reference in New Issue
Block a user