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

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