netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jamal <hadi@cyberus.ca>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH]net-sched: Fix actions referencing
Date: Thu, 07 Aug 2008 05:42:57 -0400	[thread overview]
Message-ID: <1218102177.12799.12.camel@localhost> (raw)

[-- Attachment #1: Type: text/plain, Size: 65 bytes --]


Noticed while exercising Denys' iproute changes.

cheers,
jamal

[-- Attachment #2: act_r --]
[-- Type: text/plain, Size: 1067 bytes --]

net-sched: Fix actions referencing

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>

---
commit 82ca26fa474171326de9851a2f547c490f8e7276
tree 04ebfd9dcb15d463a0e49740940f0c8e86916a25
parent bb7564f1e081c18dae905c8fc871269f4a81ba99
author Jamal Hadi Salim <hadi@cyberus.ca> Thu, 07 Aug 2008 05:37:51 -0400
committer Jamal Hadi Salim <hadi@cyberus.ca> Thu, 07 Aug 2008 05:37:51 -0400

 net/sched/act_api.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index d308c19..26c7e1f 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;

             reply	other threads:[~2008-08-07 12:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-07  9:42 jamal [this message]
2008-08-08  3:37 ` [PATCH]net-sched: Fix actions referencing David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1218102177.12799.12.camel@localhost \
    --to=hadi@cyberus.ca \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).