* Casting sock to inet_timewait_sock @ 2011-01-14 14:47 Daniel Baluta 2011-01-14 14:49 ` Daniel Baluta 2011-01-14 21:23 ` Michael Blizek 0 siblings, 2 replies; 3+ messages in thread From: Daniel Baluta @ 2011-01-14 14:47 UTC (permalink / raw) To: kernelnewbies 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Casting sock to inet_timewait_sock 2011-01-14 14:47 Casting sock to inet_timewait_sock Daniel Baluta @ 2011-01-14 14:49 ` Daniel Baluta 2011-01-14 21:23 ` Michael Blizek 1 sibling, 0 replies; 3+ messages in thread From: Daniel Baluta @ 2011-01-14 14:49 UTC (permalink / raw) To: kernelnewbies 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Casting sock to inet_timewait_sock 2011-01-14 14:47 Casting sock to inet_timewait_sock Daniel Baluta 2011-01-14 14:49 ` Daniel Baluta @ 2011-01-14 21:23 ` Michael Blizek 1 sibling, 0 replies; 3+ messages in thread From: Michael Blizek @ 2011-01-14 21:23 UTC (permalink / raw) To: kernelnewbies 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-14 21:23 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-01-14 14:47 Casting sock to inet_timewait_sock Daniel Baluta 2011-01-14 14:49 ` Daniel Baluta 2011-01-14 21:23 ` Michael Blizek
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).