From 65a71a86377337fcff23c907f657d74e2abe510a Mon Sep 17 00:00:00 2001 From: Muhammad Hewedy Date: Mon, 23 Nov 2020 12:11:54 +0300 Subject: [PATCH] add more logging --- ip/cidr.go | 4 ---- ip/ip.go | 1 + ip/ping.go | 3 +++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ip/cidr.go b/ip/cidr.go index 6977601..74f49fe 100644 --- a/ip/cidr.go +++ b/ip/cidr.go @@ -5,7 +5,6 @@ import ( "fmt" "math" "net" - "strings" ) type cidr struct { @@ -45,9 +44,6 @@ func getCIDRs() []cidr { cidrs := make([]cidr, 0) for _, iface := range ifaces { - if strings.Contains(iface.Name, "VirtualBox") { - continue - } addrs, err := iface.Addrs() if err != nil { diff --git a/ip/ip.go b/ip/ip.go index 0ff1f8e..123fd41 100644 --- a/ip/ip.go +++ b/ip/ip.go @@ -29,6 +29,7 @@ func Find(vmName string, purge bool) (string, error) { var pong bool if purge { + debug.Log("purge=1, purging...") ping() pong = true } diff --git a/ip/ping.go b/ip/ping.go index c0128ae..c36f4c4 100644 --- a/ip/ping.go +++ b/ip/ping.go @@ -2,12 +2,14 @@ package ip import ( "github.com/mhewedy/vermin/cmd" + "github.com/mhewedy/vermin/debug" "sync" ) func ping() { cidrs := getCIDRs() + debug.Log("ciders: %s", cidrs) var wg sync.WaitGroup wg.Add(len(cidrs)) @@ -19,6 +21,7 @@ func ping() { continue } + debug.Log("pining cider %s", c) go func(c cidr) { pingCIDR(c) wg.Done()