- 论坛徽章:
- 1
|
哪位大哥能帮忙解释一下这个函数的用意是什么,代码里有很大的一段注释,但是感觉还是不很明白。说真的,虽然kernel说20%的是注释,但是感觉那些注释都写的不是很好懂
- /* Undo procedures. */
- /* We can clear retrans_stamp when there are no retransmissions in the
- * window. It would seem that it is trivially available for us in
- * tp->retrans_out, however, that kind of assumptions doesn't consider
- * what will happen if errors occur when sending retransmission for the
- * second time. ...It could the that such segment has only
- * TCPCB_EVER_RETRANS set at the present time. It seems that checking
- * the head skb is enough except for some reneging corner cases that
- * are not worth the effort.
- *
- * Main reason for all this complexity is the fact that connection dying
- * time now depends on the validity of the retrans_stamp, in particular,
- * that successive retransmissions of a segment must not advance
- * retrans_stamp under any conditions.
- */
- static bool tcp_any_retrans_done(const struct sock *sk)
- {
- const struct tcp_sock *tp = tcp_sk(sk);
- struct sk_buff *skb;
- if (tp->retrans_out)
- return true;
- skb = tcp_write_queue_head(sk);
- if (unlikely(skb && TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS))
- return true;
- return false;
- }
复制代码
|
|