Re: [PATCH] netfilter: use per-cpu spinlock rather than RCU (v3)

From: Patrick McHardy
Date: Thu Apr 16 2009 - 08:32:06 EST


Jan Engelhardt wrote:
On Thursday 2009-04-16 14:12, Patrick McHardy wrote:
Jan Engelhardt wrote:
So change per-cpu spinlocks to per-cpu rwlocks and use read_lock() in ipt_do_table() to allow recursion...

iptables cannot quite recurse into itself due to the comefrom stuff.
Actually it can by using the REJECT target:

Yes, but it has to return an absolute verdict (which REJECT does),
so it's not really a recursion, it's more like a goto without return.

Its recursion in the sense that we reenter the same code path,
while holding a lock. The verdict is issued *after* recursing.

A (quite ugly) workaround would be to have ipt_REJECT queue
the packets to a temporary queue and have ipt_do_table call
dst_output() after dropping the lock.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/