Skip to contentSkip to conversation

ip_conntrack_lock usage?

DISCUSSION Ian Latter 2 participants 2 messages Jun 8, 2003 – Jun 11, 2003 netfilter

lore
Share & tools
lore

Ian Latter

author
#0 lore raw

Hey dudes,

I finally have my dev machine back online, and a long weekend to look at
the RSH and RPC bugs, and the RPC enhancements. However, I've gotten myself bogged down in trying to understand usage of "ip_conntrack_lock" READ/WRITE LOCKs.

The old rpc-recent module(s) had a comment at the top that said;
+/* For future conections RPC, using client's cache bindings
+ * I'll use ip_conntrack_lock to lock these lists */

.. why would you use a global locking mechanism for lists that only have local implications?

The added confusion is that I can see no documentation on it in the HowTo's
or FAQ's .. and the only mentions in the Netfilter mailling archives are either code references from the conntrack root code, or discussions on potential performance bottlenecks.

Should I be trying to implement a global locking structure in the RPC code,
or should I stick with what I've got?

Thanks,

--
Ian Latter
Internet and Networking Security Officer
Macquarie University

#1 lore raw
Quoted 8 lines · Ian Latter

Hey dudes,

The old rpc-recent module(s) had a comment at the top that said;
+/* For future conections RPC, using client's cache bindings
+ * I'll use ip_conntrack_lock to lock these lists */

.. why would you use a global locking mechanism for lists that only have local implications?

I don't know the code in detail, but I don't see why. If the private lists are only changed from within the rpc helper, there is no point using the global lock.

The only reason I can think of:

ip_conntrack_lock is taken already by the core for most of the places the lists are modified. Then it makes more sense to use ip_conntrack_lock from the few remaining places than adding a new (for most cases nested) lock

Quoted 2 lines

Thanks,
Ian Latter

Signature · 5 lines
- Harald Welte <[email protected]>             http://www.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