- 论坛徽章:
- 0
|
在2.6的早期内核代码里,好像是在2.6.26之前,有个全局变量tcp_socket: 主要用来发送rst和ack
我想问的是在SYN_RCV状态时,有如下代码:- 函数tcp_check_req中
- /* Also, it would be not so bad idea to check rcv_tsecr, which
- * is essentially ACK extension and too early or too late values
- * should cause reset in unsynchronized states.
- */
- /* RFC793: "first check sequence number". */
- if (paws_reject || !tcp_in_window(TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq,
- tcp_rsk(req)->rcv_isn + 1, tcp_rsk(req)->rcv_isn + 1 + req->rcv_wnd)) {
- /* Out of window: send ACK and drop. */
- if (!(flg & TCP_FLAG_RST))
- req->rsk_ops->send_ack(sk, skb, req);
- if (paws_reject)
- NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_PAWSESTABREJECTED);
- return NULL;
- }
复制代码 这个函数是listen socket在接收到SYN ACK之后进入处理流程,这里req->rsk_ops->send_ack(sk, skb, req);最终调用tcp_v4_send_ack->ip_send_reply,
传递给ip_send_reply的参数用到了全局变量tcp_socket->sk
我的问题是,req->rsk_ops->send_ack(sk, skb, req);这里为什么不直接传递当前listen 的sock? |
|