Skip to content

Commit

Permalink
Process monitor: Ignore missing /proc/net/tcp6
Browse files Browse the repository at this point in the history
This makes Packetbeat's process monitor to continue execution when
/proc/net/tcp6 is missing (ipv6 disabled in kernel).

Closes elastic#19941
  • Loading branch information
adriansr committed Jul 15, 2020
1 parent 751a1d3 commit 4d6596a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
*Packetbeat*

- Enable setting promiscuous mode automatically. {pull}11366[11366]
- Fix process monitoring when ipv6 is disabled under Linux. {issue}19941[19941] {pull}19945[19945]

*Winlogbeat*

Expand Down
4 changes: 3 additions & 1 deletion packetbeat/procs/procs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ func (proc *ProcessesWatcher) GetLocalPortToPIDMapping(transport applayer.Transp
logp.Err("GetLocalPortToPIDMapping: parsing '%s': %s", sourceFiles.ipv4, err)
return nil, err
}

ipv6socks, err := socketsFromProc(sourceFiles.ipv6, true)
if err != nil {
// Ignore the error when /proc/net/tcp6 doesn't exists (ipv6 disabled).
if err != nil && !os.IsNotExist(err) {
logp.Err("GetLocalPortToPIDMapping: parsing '%s': %s", sourceFiles.ipv6, err)
return nil, err
}
Expand Down

0 comments on commit 4d6596a

Please sign in to comment.