netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fib_rules: fix unresolved_rules counting
@ 2011-10-18  1:20 Yan, Zheng
  2011-10-18  3:47 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Yan, Zheng @ 2011-10-18  1:20 UTC (permalink / raw)
  To: netdev@vger.kernel.org, davem@davemloft.net

we should decrease ops->unresolved_rules when deleting a unresolved rule.

Signed-off-by: Zheng Yan <zheng.z.yan@intel.com>
---
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 3231b46..27071ee 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -475,8 +475,11 @@ static int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
 
 		list_del_rcu(&rule->list);
 
-		if (rule->action == FR_ACT_GOTO)
+		if (rule->action == FR_ACT_GOTO) {
 			ops->nr_goto_rules--;
+			if (rtnl_dereference(rule->ctarget) == NULL)
+				ops->unresolved_rules--;
+		}
 
 		/*
 		 * Check if this rule is a target to any of them. If so,

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-19 23:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-18  1:20 [PATCH] fib_rules: fix unresolved_rules counting Yan, Zheng
2011-10-18  3:47 ` Eric Dumazet
2011-10-19 23:18   ` David Miller

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).