This commit is contained in:
crusader
2018-09-05 05:03:43 +09:00
parent 4e18a6f932
commit b9ac5b2a71
9 changed files with 9 additions and 18 deletions

View File

@@ -54,9 +54,7 @@ func scanV4(discoverySession session.DiscoverySession) error {
}
delay.Store(true)
if h := handlePacketICMP4(zone, targetHosts, hosts, packet); nil != h {
if h != nil {
discoverySession.AddHost(h)
}
go discoverySession.AddHost(h)
}
case <-ticker.C:
if false == delay.Load().(bool) {

View File

@@ -49,16 +49,11 @@ func scanV6(discoverySession session.DiscoverySession) error {
select {
case packet, ok := <-icmpChan:
if !ok {
// logging.Logger().Debugf("icmp channel is closed")
return
}
delay.Store(true)
if h := handlePacketICMP6(zone, targetHosts, hosts, packet); nil != h {
if h != nil {
discoverySession.AddHost(h)
}
// resultChan <- h
go discoverySession.AddHost(h)
}
case <-ticker.C:
if false == delay.Load().(bool) {