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

From: Bob Matthews (bob@CS.WM.EDU)
Date: Wed Jun 20 2001 - 17:48:52 EST


I've got a couple of questions about TCP code that I'm hoping someone
could answer. I have a kernel thread with a struct sock waiting for a
state_change callback, but the callback is never getting, well, called
back.

When I setup the socket, I do the following steps

sock_create (new_socket, ...)
setup the sin structure
new_socket->ops->bind (new_socket, (struct sockaddr_in *) sin, ...)
new_socket->ops->listen (new_socket, ...)

I then setup the callbacks:

new_socket->sk->state_change = foo;
new_socket->sk->data_ready = bar;

At this point, everything in new_socket and new_socket->sk looks OK to me.

When I try and send data to the socket from the other end, however,
neither of these callbacks is ever activated.

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?

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

Bob

-- 

- 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/



This archive was generated by hypermail 2b29 : Sat Jun 23 2001 - 21:00:29 EST