summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamal Hadi Salim <hadi@cyberus.ca>2008-08-27 22:38:11 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-09-08 04:44:24 -0700
commit4cd12f888ddb3a535ca34104593a0a62724ab104 (patch)
tree5cb9699455ad18c3c9e8d9dab8267de51ed5e9c0
parent685f605a498b73759cbcbc816089e804710fcc48 (diff)
pkt_sched: Fix actions referencing
[ Upstream commit 76aab2c1eae491a5d73ac83deec97dd28ebac584 ] When an action is added several times with the same exact index it gets deleted on every even-numbered attempt. This fixes that issue. Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--net/sched/act_api.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 74e662cbb2c5..b5e116c28e72 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -205,10 +205,9 @@ struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a, int bind,
{
struct tcf_common *p = NULL;
if (index && (p = tcf_hash_lookup(index, hinfo)) != NULL) {
- if (bind) {
+ if (bind)
p->tcfc_bindcnt++;
- p->tcfc_refcnt++;
- }
+ p->tcfc_refcnt++;
a->priv = p;
}
return p;