aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index a6d7c584f53b..8d23cc7efbad 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1109,7 +1109,12 @@ restart:
1109 printk("\n"); 1109 printk("\n");
1110 } 1110 }
1111#endif 1111#endif
1112 rt_hash_table[hash].chain = rt; 1112 /*
1113 * Since lookup is lockfree, we must make sure
1114 * previous writes to rt are comitted to memory
1115 * before making rt visible to other CPUS.
1116 */
1117 rcu_assign_pointer(rt_hash_table[hash].chain, rt);
1113 spin_unlock_bh(rt_hash_lock_addr(hash)); 1118 spin_unlock_bh(rt_hash_lock_addr(hash));
1114 *rp = rt; 1119 *rp = rt;
1115 return 0; 1120 return 0;