Re: [QUESTION]: sk->data_ready/state_change callbacks in struct sock

David S. Miller (davem@redhat.com)
Wed, 20 Jun 2001 16:00:26 -0700 (PDT)


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/