OSDN Git Service

netfilter: nf_tables: handle chain name lookups via rhltable
authorFlorian Westphal <fw@strlen.de>
Sat, 2 Jun 2018 21:41:06 +0000 (23:41 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 2 Jun 2018 23:18:37 +0000 (01:18 +0200)
commit1b2470e59fb1e983a3655feba30cdfc03e609d51
tree5298d1333c969020c364831d20035ce9cc79070d
parent290180e2448c02d6b391455937098882a73a9494
netfilter: nf_tables: handle chain name lookups via rhltable

If there is a significant amount of chains list search is too slow, so
add an rhlist table for this.

This speeds up ruleset loading: for every new rule we have to check if
the name already exists in current generation.

We need to be able to cope with duplicate chain names in case a transaction
drops the nfnl mutex (for request_module) and the abort of this old
transaction is still pending.

The list is kept -- we need a way to iterate chains even if hash resize is
in progress without missing an entry.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c