Skip to contentSkip to conversation

ipv6: delay fib6_sernum increase in fib6_add

PATCH In review zhang kai 2 participants 2 messages Sep 9, 2021 – Sep 12, 2021

Subsystems (3)
lore
Share & tools
lore

zhang kai

author
#0 lore raw

PATCH 1/1 ipv6: delay fib6_sernum increase in fib6_add

only increase fib6_sernum in net namespace after add fib6_info successfully.

---
 net/ipv6/ip6_fib.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/ipv6/ip6_fib.c +1 -2
index 4d7b93baa..07de2fbc9 100644
@@ -1377,7 +1377,6 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt,
 	int err = -ENOMEM;
 	int allow_create = 1;
 	int replace_required = 0;
-	int sernum = fib6_new_sernum(info->nl_net);
 
 	if (info->nlh) {
 		if (!(info->nlh->nlmsg_flags & NLM_F_CREATE))
@@ -1477,7 +1476,7 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt,
 	if (!err) {
 		if (rt->nh)
 			list_add(&rt->nh_list, &rt->nh->f6i_list);
-		__fib6_update_sernum_upto_root(rt, sernum);
+		__fib6_update_sernum_upto_root(rt, fib6_new_sernum(info->nl_net));
 		fib6_start_gc(info->nl_net, rt);
 	}
 
Signature · 1 line
2.17.1