Casting sock to inet_timewait_sock

Michael Blizek michi1 at
Fri Jan 14 16:23:00 EST 2011


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 ).

programing a layer 3+4 network protocol for mesh networks

More information about the Kernelnewbies mailing list