Patchwork fib_rules: fix unresolved_rules counting

login
register
mail settings
Submitter Yan, Zheng
Date Oct. 18, 2011, 1:20 a.m.
Message ID <4E9CD45C.9050608@intel.com>
Download mbox | patch
Permalink /patch/120348/
State Accepted
Delegated to: David Miller
Headers show

Comments

Yan, Zheng - Oct. 18, 2011, 1:20 a.m.
we should decrease ops->unresolved_rules when deleting a unresolved rule.

Signed-off-by: Zheng Yan <zheng.z.yan@intel.com>
---
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eric Dumazet - Oct. 18, 2011, 3:47 a.m.
Le mardi 18 octobre 2011 à 09:20 +0800, Yan, Zheng a écrit :
> 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,

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Oct. 19, 2011, 11:18 p.m.
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 18 Oct 2011 05:47:31 +0200

> Le mardi 18 octobre 2011 à 09:20 +0800, Yan, Zheng a écrit :
>> we should decrease ops->unresolved_rules when deleting a unresolved rule.
>> 
>> Signed-off-by: Zheng Yan <zheng.z.yan@intel.com>
 ...
> 
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

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,