Skip to content

Commit

Permalink
improving use of the IPAddress data pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
caffix committed Dec 5, 2024
1 parent 55cd7b6 commit 9c8036b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
6 changes: 3 additions & 3 deletions engine/plugins/support/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 9c8036b

Please sign in to comment.