All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amin Azez <azez@ufomechanic.net>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@lists.netfilter.org
Subject: more nf_conntrack/ip_conntrack questions
Date: Mon, 12 Sep 2005 11:23:51 +0100	[thread overview]
Message-ID: <43255737.3040109@ufomechanic.net> (raw)
In-Reply-To: <4321A585.5050205@trash.net>

2 questions, part style, relating to nf_conntrack and ip_conntrack

In nf_conntrack_tuple.h in

#define NF_CT_TUPLE_U_BLANK(tuple) \
do { \
(tuple)->src.u.all = 0; \
(tuple)->dst.u.all = 0; \
memset((tuple)->src.u3.all, 0, \
sizeof(u_int32_t)*NF_CT_TUPLE_L3SIZE); \
memset((tuple)->dst.u3.all, 0, \
sizeof(u_int32_t)*NF_CT_TUPLE_L3SIZE); \
} while (0)

why do we have:
sizeof(u_int32_t)*NF_CT_TUPLE_L3SIZE

as the size, instead of just:
sizeof((tuple)->dst.u3)

it seems to presume that:
1) .all will always be the biggest member
2) .all is always an array of NF_CT_TUPLE_L3SIZE of u_int32_t

I wonder why we need to duplicate this knowledge when a small definition
appears to suffice.

Also; and I asked about somehting similar before, why is
ip_conntrack_tuple.src almost exactly the same as
ip_conntrack_tuple.dst, but .src is defined in terms of pre-declared
structs and unions but dst is declared in terms of (nearly) identical
structs and unions. With nf_conntrack as far as I can tell they are the
same. The inline explanation of "manipulatable" doesn't seem to cover it.

Azez

  reply	other threads:[~2005-09-12 10:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-09 14:56 nf_conntrack/ip_conntrack disrepencies Amin Azez
2005-09-09 15:08 ` Patrick McHardy
2005-09-12 10:23   ` Amin Azez [this message]
2005-09-12 10:42     ` more nf_conntrack/ip_conntrack questions Patrick McHardy
2005-09-12 11:29       ` Yasuyuki KOZAKAI
2005-09-12 11:41         ` Yasuyuki KOZAKAI
     [not found]         ` <200509121141.j8CBfHp1003079@toshiba.co.jp>
2005-09-12 12:04           ` Amin Azez
2005-09-12 12:56             ` Yasuyuki KOZAKAI
     [not found]             ` <200509121256.j8CCuHwd028705@toshiba.co.jp>
2005-09-13 13:15               ` Harald Welte

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=43255737.3040109@ufomechanic.net \
    --to=azez@ufomechanic.net \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@lists.netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.