Skip to content

Commit

Permalink
tweaking 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 d931a8b commit 3570cf3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion engine/plugins/dns/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (d *dnsPlugin) Start(r et.Registry) error {
if err := r.RegisterHandler(&et.Handler{
Plugin: d,
Name: d.reverse.name,
Priority: 9,
Priority: 8,
MaxInstances: support.MaxHandlerInstances,
Transforms: []string{string(oam.FQDN)},
EventType: oam.IPAddress,
Expand Down
4 changes: 2 additions & 2 deletions engine/plugins/support/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func IPToNetblock(session et.Session, ip *oamnet.IPAddress) (*oamnet.Netblock, e
return nil, errors.New("no netblock match in the cache")
}

addNetblock(session.ID().String(), found)
AddNetblock(session.ID().String(), found)
return found, nil
}

Expand Down Expand Up @@ -205,7 +205,7 @@ func lookupNetblock(sessid string, ip *oamnet.IPAddress) (*oamnet.Netblock, erro
return found, nil
}

func addNetblock(sessid string, nb *oamnet.Netblock) {
func AddNetblock(sessid string, nb *oamnet.Netblock) {
mlock.Lock()
defer mlock.Unlock()

Expand Down
3 changes: 2 additions & 1 deletion engine/plugins/whois/bgptools/netblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (r *netblock) check(e *et.Event) error {
if reserved, _ := amassnet.IsReservedAddress(ipstr); reserved {
return nil
}
// check if there's a netblock and autonomous system associated with this IP address
// check if there's a netblock associated with this IP address
if _, err := support.IPToNetblock(e.Session, ip); err == nil {
// the rest of the work will be done further down the pipeline
return nil
Expand All @@ -58,6 +58,7 @@ func (r *netblock) check(e *et.Event) error {

if nb != nil {
r.process(e, e.Entity, nb)
support.AddNetblock(e.Session.ID().String(), nb.Asset.(*oamnet.Netblock))
}
return nil
}
Expand Down

0 comments on commit 3570cf3

Please sign in to comment.