Skip to contentSkip to conversation

fib_rules: fix unresolved_rules counting

PATCH Applied Yan, Zheng 3 participants 3 messages Oct 18, 2011 – Oct 19, 2011

Subsystems (3)
lore
Share & tools
lore

Yan, Zheng

author
#0 lore raw

PATCH 1/1 fib_rules: fix unresolved_rules counting

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

---

net/core/fib_rules.c +4 -1
index 3231b46..27071ee 100644
@@ -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 on v1 1/1
#1 lore raw
Quoted 11 lines · Zheng

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

---

net/core/fib_rules.c +0 -0
index 3231b46..27071ee 100644
@@ -475,8 +475,11 @@ static int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
 
 		list_del_rcu(&rule->list);

net/core/fib_rules.c static int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) · line 485

Quoted 10 lines
net/core/fib_rules.c +4 -1
 
-		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,