Skip to content

Commit

Permalink
tcptop: Filter out negative values in receive probe
Browse files Browse the repository at this point in the history
When tcp_cleanup_rbuf() is called from tcp_recvmsg(), "copied" may be an
error code, especially -EAGAIN for non-blocking receives.
  • Loading branch information
gobenji authored and drzaeus77 committed Aug 11, 2017
1 parent 8e86b9e commit 81ad054
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/tcptop.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ def range_check(string):
u16 dport = 0, family = sk->__sk_common.skc_family;
u64 *val, zero = 0;
if (copied <= 0)
return 0;
if (family == AF_INET) {
struct ipv4_key_t ipv4_key = {.pid = pid};
ipv4_key.saddr = sk->__sk_common.skc_rcv_saddr;
Expand Down

0 comments on commit 81ad054

Please sign in to comment.