Skip to content

Commit

Permalink
packetbeat/beater: make sure Npcap installation runs before interface…
Browse files Browse the repository at this point in the history
…s are needed

Previously installNpcap was run after Create, which depends on having interfaces up
to establish sniffers, and so was too late. So move the call to the front of Create
to ensure that the library is installed by the time that it is needed.
  • Loading branch information
efd6 committed Feb 15, 2022
1 parent 9d26aea commit 927b627
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...main[Check the HEAD dif

*Packetbeat*

- Add automated OEM Npcap installation handling. {pull}29112[29112]
- Add automated OEM Npcap installation handling. {pull}29112[29112] {pull}30396[30396]
- Add support for capturing TLS random number and OCSP status request details. {issue}29962[29962] {pull}30102[30102]

*Functionbeat*
Expand Down
6 changes: 0 additions & 6 deletions packetbeat/beater/packetbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ func (pb *packetbeat) Run(b *beat.Beat) error {
}
}()

// Install Npcap if needed.
err := installNpcap(b)
if err != nil {
return err
}

if !b.Manager.Enabled() {
return pb.runStatic(b, pb.factory)
}
Expand Down
6 changes: 6 additions & 0 deletions packetbeat/beater/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ func (p *processorFactory) Create(pipeline beat.PipelineConnector, cfg *common.C
return nil, err
}

// Install Npcap if needed.
err = installNpcap(p.beat)
if err != nil {
return nil, err
}

publisher, err := publish.NewTransactionPublisher(
p.beat.Info.Name,
p.beat.Publisher,
Expand Down

0 comments on commit 927b627

Please sign in to comment.