[NETFILTER] CLUSTERIP: introduce reference counting for entries
authorKOVACS Krisztian <hidden@balabit.hu>
Fri, 16 Sep 2005 23:59:46 +0000 (16:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Sep 2005 23:59:46 +0000 (16:59 -0700)
commit4451362445b2d83886003f1d739b94e4f000eeeb
tree2f7d272bcb83011ea7df364f01ad08574701cf86
parent1cbf07478bbf3e350a2025bc5ea23fedaa95855a
[NETFILTER] CLUSTERIP: introduce reference counting for entries

The CLUSTERIP target creates a procfs entry for all different cluster
IPs.  Although more than one rules can refer to a single cluster IP (and
thus a single config structure), removal of the procfs entry is done
unconditionally in destroy(). In more complicated situations involving
deferred dereferencing of the config structure by procfs and creating a
new rule with the same cluster IP it's also possible that no entry will
be created for the new rule.

This patch fixes the problem by counting the number of entries
referencing a given config structure and moving the config list
manipulation and procfs entry deletion parts to the
clusterip_config_entry_put() function.

Signed-off-by: KOVACS Krisztian <hidden@balabit.hu>
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/netfilter/ipt_CLUSTERIP.c