All of lore.kernel.org
 help / color / mirror / Atom feed
* Conntrack & NAT question
@ 2004-07-15  9:03 KOVACS Krisztian
  2004-07-15 15:12 ` Pablo Neira
  0 siblings, 1 reply; 4+ messages in thread
From: KOVACS Krisztian @ 2004-07-15  9:03 UTC (permalink / raw)
  To: netfilter-devel


  Hi,

  While re-thinking the conntrack entry update facility of ct_sync, I
was thinking on the relation of conntrack entries, their NAT-related
information, and confirmation.

  So, in theory, I think that the tuples of an already confirmed
conntrack entry cannot be changed. Since NAT (usually) changes the reply
tuple, their NAT entries should be constant as well after confirming.
However, I'm having weird things in ct_sync... In theory, ct_sync
replicates confirmed conntrack entries only, so there shouldn't be any
problem if my theory 'confirmed entries have constant tuples' is true.
However, I have somethink like this in the update function:

	[...]

	if (new) {
		memcpy(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple, &sct->orig,
		       sizeof(struct ip_conntrack_tuple));
		memcpy(&ct->tuplehash[IP_CT_DIR_REPLY].tuple, &sct->reply,
		       sizeof(struct ip_conntrack_tuple));
	} else {
		CT_SYNC_ASSERT(memcmp(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple,
				    &sct->orig, sizeof(sct->orig)) == 0);
		CT_SYNC_ASSERT(memcmp(&ct->tuplehash[IP_CT_DIR_REPLY].tuple,
				    &sct->reply, sizeof(sct->reply)) == 0);
		CT_SYNC_DUMP_TUPLE(&sct->orig);
		CT_SYNC_DUMP_TUPLE(&sct->reply);
	}

	[...]

  The 'new' parameter means we're updating an entry we've just created.
So, unless the entry is new, we check whether the tuples in the update
message are the same as ours. And, unfortunately, I have a few assertion
failed messages in the logs... :(

  Any idea? What am I missing?

-- 
 Regards,
   Krisztian KOVACS

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

end of thread, other threads:[~2004-07-19  6:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-15  9:03 Conntrack & NAT question KOVACS Krisztian
2004-07-15 15:12 ` Pablo Neira
2004-07-15 15:42   ` Pablo Neira
2004-07-19  6:51   ` KOVACS Krisztian

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.