Ignore broadcast and network addresses when generating list of subnet IPs (#1187)
When creating a list of IPs to ping we should ignore the network and broadcast address since it will not detect any devices anyway
This commit is contained in:
parent
7c31f51ead
commit
26fb4e40b6
1 changed files with 2 additions and 2 deletions
|
|
@ -42,8 +42,8 @@ func IPsFromSubnet(arg string) (res []string) {
|
|||
for ip := gen.Next(); ip != nil; ip = gen.Next() {
|
||||
res = append(res, ip.String())
|
||||
}
|
||||
|
||||
return res
|
||||
// remove network and broadcast address
|
||||
return res[1 : len(res)-1]
|
||||
}
|
||||
|
||||
// ParseHostIPNet converts host or cidr into a host list
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue