diff --git a/probe/endpoint/procspy/procnet.go b/probe/endpoint/procspy/procnet.go index 3eabd2838..ece88a6a6 100644 --- a/probe/endpoint/procspy/procnet.go +++ b/probe/endpoint/procspy/procnet.go @@ -9,17 +9,15 @@ import ( type ProcNet struct { b []byte c Connection - wantedState uint bytesLocal, bytesRemote [16]byte seen map[uint64]struct{} } // NewProcNet gives a new ProcNet parser. -func NewProcNet(b []byte, wantedState uint) *ProcNet { +func NewProcNet(b []byte) *ProcNet { return &ProcNet{ b: b, c: Connection{}, - wantedState: wantedState, seen: map[uint64]struct{}{}, } } @@ -40,16 +38,12 @@ again: } var ( - local, remote, state, inode []byte + local, remote, inode []byte ) _, b = nextField(b) // 'sl' column local, b = nextField(b) remote, b = nextField(b) - state, b = nextField(b) - if parseHex(state) != p.wantedState { - p.b = nextLine(b) - goto again - } + _, b = nextField(b) // 'st' column _, b = nextField(b) // 'tx_queue' column _, b = nextField(b) // 'rx_queue' column _, b = nextField(b) // 'tr' column diff --git a/probe/endpoint/procspy/spy.go b/probe/endpoint/procspy/spy.go index d59de62b4..b506d587d 100644 --- a/probe/endpoint/procspy/spy.go +++ b/probe/endpoint/procspy/spy.go @@ -7,10 +7,6 @@ import ( "net" ) -const ( - tcpEstablished = 1 // according to /include/net/tcp_states.h -) - // Connection is a (TCP) connection. The Proc struct might not be filled in. type Connection struct { Transport string diff --git a/probe/endpoint/procspy/spy_linux.go b/probe/endpoint/procspy/spy_linux.go index 61f189881..6966f852f 100644 --- a/probe/endpoint/procspy/spy_linux.go +++ b/probe/endpoint/procspy/spy_linux.go @@ -61,7 +61,7 @@ func (s *linuxScanner) Connections(processes bool) (ConnIter, error) { } return &pnConnIter{ - pn: NewProcNet(buf.Bytes(), tcpEstablished), + pn: NewProcNet(buf.Bytes()), buf: buf, procs: procs, }, nil