Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/portutil/procnet/procnet_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package procnet

import (
"bufio"
"errors"
"fmt"
"os"
)
Expand Down Expand Up @@ -52,6 +53,10 @@ func ReadStatsFileData(protocol string) ([]string, error) {

fp, err := os.Open(fileAddress)
if err != nil {
// IPv6-disabled environments do not have these files.
if (fileAddress == netTCP6Stats || fileAddress == netUDP6Stats) && errors.Is(err, os.ErrNotExist) {
return nil, nil
}
return nil, err
}
defer fp.Close()
Expand Down
Loading