The comment talk for itself
> /* Find possible connection requests. */
> struct request_sock *req = inet_csk_search_req(sk, &prev, th->source,
> iph->saddr, iph->daddr);
If found some req with same th->source, iph->saddr and iph->daddr,
check for if isn't already a established session.
> if (req)
> return tcp_check_req(sk, skb, req, prev);
> nsk = inet_lookup_established(&tcp_hashinfo,
> skb->nh.iph->saddr,
> th->source, skb-> nh.iph->daddr,
> th->dest, inet_iif(skb));
// if is an already established, session, check if isn't a socket in
timewait state.
> if (nsk) {
// if not, lock the child socket and return
> if (nsk->sk_state != TCP_TIME_WAIT) {
> bh_lock_sock(nsk);
> return nsk;
> }
> inet_twsk_put(inet_twsk(nsk));
> return NULL;
> }
> #ifdef CONFIG_SYN_COOKIES
> if (!th->rst && !th->syn && th->ack)
> sk = cookie_v4_check(sk, skb, &(IPCB(skb)->opt));
> #endif
// else return sk
> return sk;
> }
>
> Because the server is running just now and at the LISTEN state, so there
> is nothing in the listen queue's request_sock array. So the return value of
> the Line 8 -- inet_csk_search_req() should be NULL, and then the " return
> tcp_check_req(sk, skb, req, prev);" at Line 11 should NOT be executed.
> IS that Right? Could you please explain this function for me? I am very
> grateful.
>
> R.wen
>
If you have more doubts please feel free to contact me, I worked
almost one year and a half with the tcp subsystem.
--
Best Regards
Alan Menegotto
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to eca...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ
Thats great Alan.
Please, CC the conversation with R Wen to the list too.
It may help someone else too.
Thanks
~psr
>
>
> --
> Best Regards
>
> Alan Menegotto
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to eca...@nl.linux.org
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>
--
play the game