From: michi1@michaelblizek.twilightparadox.com (Michael Blizek)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Casting sock to inet_timewait_sock
Date: Fri, 14 Jan 2011 22:23:00 +0100 [thread overview]
Message-ID: <20110114212300.GA2060@michaelblizek.twilightparadox.com> (raw)
In-Reply-To: <AANLkTim=EaxO1WL1pqfse9xqY3vduAfqbcBh0o9iEJv_@mail.gmail.com>
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
prev parent reply other threads:[~2011-01-14 21:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110114212300.GA2060@michaelblizek.twilightparadox.com \
--to=michi1@michaelblizek.twilightparadox.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).