All of lore.kernel.org
 help / color / mirror / Atom feed
* nf_conntrack/ip_conntrack disrepencies
@ 2005-09-09 14:56 Amin Azez
  2005-09-09 15:08 ` Patrick McHardy
  0 siblings, 1 reply; 9+ messages in thread
From: Amin Azez @ 2005-09-09 14:56 UTC (permalink / raw)
  To: netfilter-devel

in nf_conntrack_tuple.h we have:
static inline int nf_ct_tuple_src_equal(const struct nf_conntrack_tuple *t1,
                                        const struct nf_conntrack_tuple *t2)
{
        return (t1->src.u3.all[0] == t2->src.u3.all[0] &&
                t1->src.u3.all[1] == t2->src.u3.all[1] &&
                t1->src.u3.all[2] == t2->src.u3.all[2] &&
                t1->src.u3.all[3] == t2->src.u3.all[3] &&
                t1->src.u.all == t2->src.u.all &&
                t1->src.l3num == t2->src.l3num &&
                t1->dst.protonum == t2->dst.protonum);
}

In ip_conntrack_tuple.h we have:
static inline int ip_ct_tuple_src_equal(const struct ip_conntrack_tuple *t1,
                                        const struct ip_conntrack_tuple *t2)
{
        return t1->src.ip == t2->src.ip
                && t1->src.u.all == t2->src.u.all;
}


nf_conntrack compares the dst.protonum (makes sense) but the
ip_conntrack doesn't. Is there the danger of ip_conntrack selecting
wrong matching tuples sometimes? Perhaps only in the rare case where the
hashes also match (unlikely) but I thought I would point this out.

Does protonum really belong in the dst member? Correspondingly, for
nf_conntrack, does l3num really belong in src?

The final thing that troubles me is that the dst member seems to have
things unrelated, like "dir" and "protonum", why are these part of
nf_conntrack_tuple.dst and not the top level nf_conntrack_tuple struct?

Sam

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-09-13 13:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-09 14:56 nf_conntrack/ip_conntrack disrepencies Amin Azez
2005-09-09 15:08 ` Patrick McHardy
2005-09-12 10:23   ` more nf_conntrack/ip_conntrack questions Amin Azez
2005-09-12 10:42     ` 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

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.