lkml.org 
[lkml]   [2001]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [QUESTION]: sk->data_ready/state_change callbacks in struct sock

Bob Matthews writes:
> So, here are my questions:
>
> - My understanding from the code is that sk->state_change is called when a
> struct sock transits from SYN_RCVD to ESTABLISHED and from ESTABLISHED to
> {CLOSE_WAIT,FIN_WAIT_1}. Is this correct?

This happens for the CHILD socket, not the listening one.

> - sk->data_ready is called whenever any new data is deposited in the
> associated sk_buff. Is this correct?

Yes, and for listening sockets this is the callback made when a new
connection comes in. See net/sunrpc/svcsock.c function
svc_tcp_listen_data_ready(), it's doing what you want to do. Make
sure to check in a recent kernel because this used to make the same
mistake you are making, using state_change instead of data_ready on a
listening socket.

Later,
David S. Miller
davem@redhat.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:55    [W:0.025 / U:1.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site