diff --git a/engine/plugins/service_discovery/http_probes/ipaddr_endpoint.go b/engine/plugins/service_discovery/http_probes/ipaddr_endpoint.go index 75042ce8..1953a617 100644 --- a/engine/plugins/service_discovery/http_probes/ipaddr_endpoint.go +++ b/engine/plugins/service_discovery/http_probes/ipaddr_endpoint.go @@ -64,7 +64,7 @@ func (r *ipaddrEndpoint) check(e *et.Event) error { r.process(e, findings, src) } - support.IPAddressSweep(e, ip, src, 25, sweepCallback) + go support.IPAddressSweep(e, ip, src, 25, sweepCallback) return nil } diff --git a/engine/plugins/support/support.go b/engine/plugins/support/support.go index 40406b04..02920d70 100644 --- a/engine/plugins/support/support.go +++ b/engine/plugins/support/support.go @@ -40,7 +40,7 @@ const MaxHandlerInstances int = 100 var done chan struct{} var subre, urlre *regexp.Regexp -var mlock sync.Mutex +var mlock sync.RWMutex var netblocks map[string]*sessnets func init() { @@ -179,8 +179,8 @@ func IPToNetblock(session et.Session, ip *oamnet.IPAddress) (*oamnet.Netblock, e } func lookupNetblock(sessid string, ip *oamnet.IPAddress) (*oamnet.Netblock, error) { - mlock.Lock() - defer mlock.Unlock() + mlock.RLock() + defer mlock.RUnlock() n, ok := netblocks[sessid] if !ok {