removed pinging of router and localIp
This commit is contained in:
parent
12f28a6623
commit
5916866ebb
@ -21,12 +21,16 @@ func PingLocal255() int {
|
|||||||
deviceCount := 0
|
deviceCount := 0
|
||||||
mu := &sync.Mutex{}
|
mu := &sync.Mutex{}
|
||||||
|
|
||||||
for i := 1; i < 255; i++ {
|
for i := 2; i < 255; i++ {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func(i int) {
|
go func(i int) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
addr := fmt.Sprintf("%s.%d", network[:len(network)-2], i)
|
addr := fmt.Sprintf("%s.%d", network[:len(network)-2], i)
|
||||||
|
|
||||||
|
if addr == localIP.String() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if ping(addr) {
|
if ping(addr) {
|
||||||
mu.Lock()
|
mu.Lock()
|
||||||
deviceCount++
|
deviceCount++
|
||||||
|
Loading…
Reference in New Issue
Block a user