Skip to contentSkip to conversation

ctnetlink unique id size?

DISCUSSION Marcus Sundberg 3 participants 3 messages Feb 17, 2005 – Feb 20, 2005 netfilter

lore
Share & tools
lore
#0 lore raw

Hi,

isn't an unsigned int a bit (or rather about 32 bits) small for keeping the id field of the ip_conntrack struct? It's bound to wrap around, and with things like long-lived ssh sessions it's even possible for two connections to be assigned the same id after a wrap-around.

Am I missing something obvious when I think ctnetlink_dump_table() will break down when the wrap-around occurs?

Using an uint64_t would on the other hand guarantee that each connection really get a unique id.

//Marcus

Signature · 3 lines
---------------------------------------+--------------------------
  Marcus Sundberg <[email protected]>  | Firewalls with SIP & NAT
 Software Developer, Ingate Systems AB |  http://www.ingate.com/
#1 lore raw
Quoted 8 lines · Marcus Sundberg

Hi,

isn't an unsigned int a bit (or rather about 32 bits) small for keeping the id field of the ip_conntrack struct? It's bound to wrap around, and with things like long-lived ssh sessions it's even possible for two connections to be assigned the same id after a wrap-around.

Quoted 5 lines

Am I missing something obvious when I think ctnetlink_dump_table() will break down when the wrap-around occurs?

Using an uint64_t would on the other hand guarantee that each connection really get a unique id.

We had a long discussion about this an the result was that it has to be 64 bit. Search the archives if you are interested, the subject is "ctnetlink questions". I'm surprised too that it now is 32 bit. Maybe Harald knows the reason.

Regards
Patrick

#2 lore raw
Quoted 12 lines · Patrick McHardy
Quoted 11 lines · Marcus Sundberg

Hi,

isn't an unsigned int a bit (or rather about 32 bits) small for keeping the id field of the ip_conntrack struct? It's bound to wrap around, and with things like long-lived ssh sessions it's even possible for two connections to be assigned the same id after a wrap-around.

Am I missing something obvious when I think ctnetlink_dump_table() will break down when the wrap-around occurs?

Quoted 7 lines
Quoted 2 lines

Using an uint64_t would on the other hand guarantee that each connection really get a unique id.

We had a long discussion about this an the result was that it has to be 64 bit. Search the archives if you are interested, the subject is "ctnetlink questions". I'm surprised too that it now is 32 bit. Maybe Harald knows the reason.

my guess is that nobody has ever increased it's size since that discussion was over.

Quoted 2 lines

Regards
Patrick

Signature · 5 lines
- Harald Welte <[email protected]>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie