iovisor/bcc

Incorrect calculation of recv throughput in tcptop.py

Open

#5,352 建立於 2025年7月4日

在 GitHub 查看
 (11 留言) (6 反應) (0 負責人)C (22,409 star) (4,051 fork)batch import
bughelp wanted

描述

tcp_cleanup_rbuf is called several times in a loop inside tcp_recvmsg. At the same time, it is passed the accumulated parameter "copied". Thus, the same data is taken into account several times.

int tcp_recvmsg(...) {
     ...
     int copied = 0;
     ...
     do {
         ...
         tcp_cleanup_rbuf(sk, copied);
         ...
         copied += used;
         ...
     } while (len > 0);
     
     tcp_cleanup_rbuf(sk, copied);
     return copied;
     ...
}

貢獻者指南

Incorrect calculation of recv throughput in tcptop.py · iovisor/bcc#5352 | Good First Issue