Casting sock to inet_timewait_sock
Hello, When casting sock to inet_timewait_sock ([1]) it is assumed that sock points to a structure of type inet_timewait_sock. Is there a way to check if a sock struct wraps around a inet_timewait_sock struct? thanks, Daniel. [1] http://lxr.linux.no/linux+v2.6.37/include/net/inet_timewait_sock.h#L189
Hello, When casting sock to inet_timewait_sock ([1]) it is assumed that sock points to a structure of type inet_timewait_sock. Is there a way to check if a sock struct wraps around a inet_timewait_sock struct? thanks, Daniel. [1] http://lxr.linux.no/linux+v2.6.37/include/net/inet_timewait_sock.h#L189
Hi! On 16:47 Fri 14 Jan , Daniel Baluta wrote:
Hello,
When casting sock to inet_timewait_sock ([1]) it is assumed that sock points to a structure of type inet_timewait_sock.
Is there a way to check if a sock struct wraps around a inet_timewait_sock struct?
By looking at the callers of inet_twsk it seems as if sk->sk_state has to be either TCP_TIME_WAIT or DCCP_TIME_WAIT. It even seems as if both actually have the same value (see http://lxr.linux.no/linux+v2.6.36/include/linux/dccp.h#L256 ). -Michi -- programing a layer 3+4 network protocol for mesh networks see http://michaelblizek.twilightparadox.com
participants (2)
-
Daniel Baluta -
Michael Blizek